A similar question has been answered (Disable "Changes you made may not be saved" pop-up window), but somehow this still does not work for me.
I'm attempting to disable the Changes you made may not be saved.
dialog box on form input changes. I know Chrome has removed the custom message capability, but I am having difficulty disabling the box altogether. I have the following javascript at the bottom of some HTML code:
window.onbeforeunload = function() {
};
window.onbeforeunload = null;
Neither of the two work for me. When I type window.onbeforeunload
into the inspector console, I get a null
return value. Can the window.onbeforeunload = null;
be called anywhere within the lifespan of the page? Perhaps I'm misplacing it somewhere?
If you are using jQuery then below code will work for you
$(window).off('beforeunload');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With