browser-close

Can we capture an event when user presses X on the browser window?

is there a way differentiate between refresh and close in Javascript? i use window.onbeforeunload now which works great in IE. To void this being called anywhere but close, i set a flag on EVERY button ...this seems like a difficult, hacky solution, but after searching for hours on google, it was the best i could find. Isn't there an o...

Prompt User before browser close?

We have an administrative portal that our teachers constantly forget to download their latest PDF instructions before logging out and/or closing the browser window. I have looked around but can't find what I'm looking for. I want to accomplish the following goals: Goal 1 Before a user can close the browser window, they are prompted "...

Confirm Browser Exit/ On Browser Exit Techniques

I've been looking around for a while and haven't quite found what I've been looking for. My web page stores reports, and the user has the ability to save these reports. I'm looking for a method, using jquery or the javascript onunload/onbeforeunload to ask the user if they wish to save the report or continue without saving when the brow...