Body Tag: (OnLoad & OnUnload) Example

This web page is designed to show using the properties onLoad and onUnload in the <body> tag.  Click here to go to a page where you can download these examples (see Browse Window section)

This page should:

  1. (IE & NS) Popup an alert (onLoad) when the page loads.
  2. (IE & NS) Popup an (onUnload) alert then an (onLoad) alert if you refresh the window.
  3. onUnload when the window is closing.
    1. IE & NS 6.0 allows functions to be called in the onUnload when the window is closing.
    2. NS4.x does not execute the onUnload when the window is closing (works for Reload). This web page proves that.