In the below code I am using onbeforeunload
event. This event fires when tab or browser is closed. This code is working fine in Firefox but this event also fires in IE9 but in another system have IE compatibility versions IE8,9 and 10. In that compatibility mode 8,9,10. This event is not firing at all.
<script language="JavaScript">
window.onbeforeunload = WindowCloseHanlder;
function WindowCloseHanlder()
{
window.alert('My Window is reloading');
}
</script>
I had used onbeforeunload
event which calls the function windowclosehandler
. When I call this function I am just giving one alert to check whether that event fires or not.