javascript - Prevent event from triggering together with another event -


i have google.maps event handler

google.maps.event.addlistener('place_changed', function(){   ... }) 

attached input (which autocomplete) , handler attached same input

input.addeventlistener('change', function(){ ... }) 

how can prevent change triggering place_changed? accurate, if place_changed dont trigger change , not vice versa.

i tried

google.maps.event.addlistener('place_changed', function(){     input.addeventlistener('change', function(){        return 0;     })  }) 

but didn't help

so read want not trigger event a when event b being triggered?

that's pretty easy:

window.e_called = false; function e1() {     window.e_called = true;     // event 1 code... }  function e2() {     window.settimeout(function()     {         if(!window.e_called)         {              // event 2 code...         }         window.e_called = false;     }, 1); } 

you of course have bind e1() , e2() , stuff, hope understand solution.


Comments

Popular posts from this blog

sublimetext3 - what keyboard shortcut is to comment/uncomment for this script tag in sublime -

java - No use of nillable="0" in SOAP Webservice -

ubuntu - Laravel 5.2 quickstart guide gives Not Found Error -