JS Popup interrupts execution of javascript -
suppose have http://www.w3schools.com/js/tryit.asp?filename=tryjs_prompt page. have event listener on click action, this:
document.addeventlistener('click', function() { mymagichere(); });
now in case of clicking on button "try it" mymagichere()
interupted js popup. want mymagichere()
performed in case of clicking on button. there way/workaround how handle situation?
try set usecapture
parameter of addeventlistener
true
. listener executed in capture phase before being executed event target.
document.addeventlistener('click',function(){ mymagichere(); }, true);
this concept of capturing , bubbling events. can see more in question
Comments
Post a Comment