Stop Propagation event doesn't seem to work in JavaScript? -


function confirmexit(e) {      var f = formchanges();  //checking whether page has been modified or not          if (f.length > 0){         if (submitform == false) {             if(!e) var e = window.event;             //e.cancelbubble ie , work             e.cancelbubble = true;             e.returnvalue = "you have made updates page have not been saved.";             //e.stoppropagation firefox doesn't work.             if (e.stoppropagation) {                 e.stoppropagation();                 e.preventdefault();             }                }     settimeout("enablebeforeunloadhandler()", "100"); }    } //ignore  window.onbeforeunload=confirmexit; function enablebeforeunloadhandler() {     window.onbeforeunload=confirmexit; } 

the page redirecting page without waiting user action when alert message displayed whether save data or not.anyone know anything?


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -