Top "Onbeforeunload" questions

The onbeforeunload event is triggered before a user navigates away.

Detecting page unload in angularjs

I have a javascript object which I need global to my angularjs application. When the application is about to be …

angularjs global-variables onbeforeunload persist rootscope
onbeforeunload confirmation screen customization

Is it possible to create a custom confirmation box for the onbeforeunload event in a browser? I tried but then …

javascript onbeforeunload confirm
Can I pop up a confirmation dialog when the user is closing the window in Safari/Chrome?

In IE and FF, i can attach an event handler to onBeforeUnload, and by passing a string to a property …

safari google-chrome onbeforeunload onunload
Browser waits for ajax call to complete even after abort has been called (jQuery)

I have some (potentially) long-running ajax calls that I would like to abort if the user navigates to another page. …

javascript jquery xmlhttprequest onbeforeunload abort
onbeforeunload event is too enthusiastic in IE9

Here's some sample test html: <!DOCTYPE html> <html> <body> <a href="javascript:alert(…

javascript internet-explorer-9 onbeforeunload
onbeforeunload - bind to selective events

I am working on a enterprise application where forms a generated dynamically and we don't have control over the code. …

jquery onbeforeunload siebel
How to execute ajax function onbeforeunload?

I'm developing a php/javascript chat. When the user logs in, his/her username is inserted in a MySQL table …

php javascript jquery onbeforeunload
How to send an HTTP request onbeforeunload in AngularJS?

I have a simple angular app that has two views that are loaded using ngRoute. I need to do some …

javascript angularjs onbeforeunload http-request
window.onbeforeunload may fire multiple times

Just because you don't see use for a feature doesn't mean it isn't useful. The Stack Exchange network, GMail, Grooveshark, …

javascript jquery onbeforeunload
Angular 6: simple confirmation on page leaving

I need to make a simple confirm window and I saw a lot of examples of how to do it …

angular typescript onbeforeunload angular-router-guards