I am using the following code to check onunload event in Jquery
$(window).unload( function () { alert("Bye now!"); } );It works great on FF, CHROME, but doesnt display the alert on IE9 when the window is closed. Any workaround ?
I am using the following code to check onunload event in Jquery
$(window).unload( function () { alert("Bye now!"); } );It works great on FF, CHROME, but doesnt display the alert on IE9 when the window is closed. Any workaround ?
You can use beforeunload
$(window).bind("beforeunload", function() { alert("Bye now!"); });
But be careful if you need to submit a form on that page: How to capture the browser window close event?
Well, try onbeforeunload (Microsoft thingy)
$(window).bind("onbeforeunload", function(){
alert('Bye now!');
});