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
Post a Comment