111
rated 0 times
[
112]
[
1]
/ answers: 1 / hits: 20368
/ 9 Years ago, thu, june 11, 2015, 12:00:00
I want to prevent browser to close page in any case or in other case, Prevent browser to do anything when onbeforeunload
is called.
Here is my code which i have tried.
(function() {
var proxied = window.onbeforeunload;
window.onbeforeunload = function(e) {
e.preventDefault();
e.stopPropagation();
//i want to stop everything
console.log('stay here');
// return 'message';
};
})();
- I want to perform a action before leaving the page (disconnect the
chat)
More From » jquery