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

What is happening when Matlab is starting a "parallel pool"? -

php - Cannot override Laravel Spark authentication with own implementation -

Qt QGraphicsScene is not accessable from QGraphicsView (on Qt 5.6.1) -