The JavaScript window.onbeforeload() event is fired just before the web page is unloaded. This gives us the ability to make sure that the user is certain about leaving the page that they are viewing. We can also use this to catch the browser closing event.
I have mixed the script with Jquery. We can use Jquery’s bind method to bind the event but using bind we can’t handle the event properly. Using the following script we can easly customize the confirmation message and also it will work on IE and most of the common web browsers.
» Read more
December 13th, 2009 
