Top "Onbeforeunload" questions

The onbeforeunload event is triggered before a user navigates away.

How can I use @HostListener('window:beforeunload') to call a method?

I am trying to call a post method I made myself before my component is unloaded, but it doesn't work. …

angular debugging onbeforeunload angular-components
Is the onbeforeunload event not supported on iPhone?

Looks like Apple has disabled the window.onbeforeunload event for iOS devices (iPhone, iPad, iPod Touch). Unfortunately I can't find …

jquery iphone mobile onbeforeunload onunload
Is there an alternative method to use onbeforeunload in mobile safari?

Is there an alternative method to use instead of onbeforeunload in mobile-safari? I've noticed that Google was able to capture …

javascript ios mobile-safari onbeforeunload
Activating OnBeforeUnload ONLY when field values have changed

What I'm trying to achieve is to Warn the user of unsaved changes if he/she tries to close a …

javascript dialog conditional triggers onbeforeunload
Javascript detect closing popup loaded with another domain

I am opening a popup window and attaching an onbeforeunload event to it like this: win = window.open("http://www.…

javascript popup onbeforeunload
Send AJAX to server beforeunload

So supposedly starting at Firefox > 4, binding the window jQuery object to beforeunload doesn't work anymore. What'd I'd like to …

javascript jquery cross-browser onbeforeunload
beforeunload Or onbeforeunload

I'm stuck working out which one of these I should be using: beforeunload or onbeforeunload They both seem to be …

javascript dom-events onbeforeunload
How to collect return value of onbeforeunload

I am displaying a warning message if user try to close window without saving the form. window.onbeforeunload = askConfirm; function …

javascript dom-events onbeforeunload
window.onbeforeunload not displaying the alert box

I just want to show a message before leaving the page, but my code doesn't works: window.onload=function(){ alert("…

javascript onbeforeunload
prevent onbeforeunload to close page in any case

I want to prevent browser to close page in any case or in other case, Prevent browser to do anything …

javascript jquery onbeforeunload