Reputation: 1057
Hi i need to catch an onUnload event but its working in firefox not in IE . Can we capture onUnload event in IE?
Upvotes: 0
Views: 2126
Reputation: 78667
<script type="text/javascript">
function unloadPage(){
return "dont leave me this way";
}
window.onbeforeunload = unloadPage;
</script>
Upvotes: 0
Reputation: 41929
There is two events in IE you can use. Click the event-name to see the MSDN details.
Upvotes: 2
Reputation: 532495
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.
Upvotes: 1