javascript - Ajax Click different of move mouse but there is a click -
i'm playing google map api , use ajax update sql qith code:
$(document).ready(function() { $('#map').click(function() { var request = $.ajax({ url: "php/clic.php", data: { label: "value" }, method: "post" }); request.done(function() { // after done. }); }); });
map si div of google map.
the problem code clic.php executed when user clicking on div if user clicking move map. don't know ajax lot, want else condition detect if s move/clic instead of simple clic!
thx!
check event.target
see if it's #map
element.
$("#map".click(function() { if (event.target != this) { return; } // rest of function });
Comments
Post a Comment