Quote:The exact handling of the unload event has varied from version to version of browsers. For example, some versions of Firefox trigger the event when a link is followed, but not when the window is closed. In practical usage, behavior should be tested on all supported browsers, and contrasted with the proprietary beforeunload event.
<script> window.onbeforeunload = function (e) { e = e || window.event; // For IE and Firefox prior to version 4 if (e) { e.returnValue = 'Sure?'; } // For Safari return 'Sure?'; }; </script>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)