tags:

views:

233

answers:

4

Hi i need to catch an onUnload event but its working in firefox not in IE . Can we capture onUnload event in IE?

A: 

You could try the onbeforeunload event.

James
+1  A: 

Could be that an installed plugin is disabling any unload handlers (see this blog post). If that's the case you could remove the plugin or switch to use onbeforeunload.

tvanfosson
+2  A: 

There is two events in IE you can use. Click the event-name to see the MSDN details.

Espo
A: 
<script type="text/javascript">

       function unloadPage(){
           return "dont leave me this way";
       }

       window.onbeforeunload = unloadPage;

</script>
redsquare