To invoke onbeforeunload event:
- Close the current window.
- Navigate to another location by entering a new address or selecting a Favorite.
- Click an anchor that refers to another document.
- Invoke the anchor.click method.
- Invoke the document.write method.
- Invoke the document.close method.
- Invoke the window.close method.
- Invoke the window.navigate or NavigateAndFind method.
- Invoke the location.replace method.
- Invoke the location.reload method.
- Specify a new value for the location.href property.
- Submit a form to the address specified in the action attribute via the input type=submit control, or invoke the form.submit method.
- Invoke the window.open method, providing the possible value _self for the window name.
- Invoke the document.open method.
- Click the Back, Forward, Refresh, or Home button.