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

Popular posts from this blog

get url and add instance to a model with prefilled foreign key :django admin -

css - Make div keyboard-scrollable in jQuery Mobile? -

ruby on rails - Seeing duplicate requests handled with Unicorn -