Note: This event fires before the document is unloaded. The document is unloaded when the user 1)navigates to a different URL or 2)attempts to close the browser window.