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

Popular posts from this blog

mysql - Dreamhost PyCharm Django Python 3 Launching a Site -

java - Sending SMS with SMSLib and Web Services -

java - How to resolve The method toString() in the type Object is not applicable for the arguments (InputStream) -