Top "Onbeforeunload" questions

The onbeforeunload event is triggered before a user navigates away.

onBeforeUnload not working correctly for Chrome

I've been using this code for some time and it worked fine until yesterday: window.onbeforeunload = function() { return "¡Atención! …

javascript google-chrome dom-events microsoft-edge onbeforeunload
Detecting whether user stayed after prompting onBeforeUnload

In a web app I'm working on, I'm capturing onBeforeUnload to ask the user whether he really wants to exit. …

javascript onbeforeunload
Don't have time to send get request on window unload

I want to notify the server on user closes browser window. I tried all of the $(window).bind("beforeunload", function() { $.…

javascript jquery notifications onbeforeunload onunload
JavaScript not working after Chrome update

I often accidentally close my Chrome browser and have to reopen and reload all the tabs that I'd been working …

javascript google-chrome onbeforeunload
Display a warning with 'onbeforeunload' when leaving a page, except if 'Submit' is clicked

I wish to display a warning if a user attepmts to leave a page that contains unsaved settings, but obviously …

javascript onbeforeunload
IE9 onbeforeunload called twice when window.location changed in button event... minimal reproduction

I've been hammering and hammering at this and just can't get anywhere. I have a cancel button that does a "…

javascript html internet-explorer-9 onbeforeunload
prevent OnBeforeUnload() event from happening in refresh/F5

I'm using onbeforeunload event to perform operations during the closing page. I do not want the event to happen in …

javascript jquery html onbeforeunload
window.beforeunload called twice in Firefox - how to get around this?

I'm creating a popup window that has a beforeunload handler installed. When the "Close" file menu item is used to …

javascript firefox onbeforeunload
Google chrome onbeforeunload wrong behavior with iframe

Let say I have two pages. One of them contains another one inside as iframe. If you subscribe to onbeforeunload …

javascript google-chrome iframe wysiwyg onbeforeunload