php - JQuery $.post never successful, why? -


i've made many different attempts @ mistake must obvious, knowledge of jquery isn't great i've tried examples straight internet, can't seem it, want pass variable "mylatlng" php file , echo result of php file on callback, php file consists of:

$data=$_post['coord']; echo $data; 

the javascript is:

$.post("/includes/eventgrab.php", { "coord": mylatlng },     function(data) {         alert("data loaded: " + data);     }, "text" ); 

i have used firebug , mylatlng hold value. please help

the below should work fine assuming have eventgrab.php @ correct location (use firebug see whether making call nicely page) , have proper value in mylatlng variable.

$.post("/includes/eventgrab.php", { coord: mylatlng }, function(data) {         alert("data loaded: " + data); }); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -