LOADING A Good-Bye PAGE

Tested with Netscape 2.0, Netscape 3.0, and M$IE 3.0 running on Win '95.

Netscape 2.0 will NOT load a page to a new window when triggered by onUnload.


PURPOSE:
To demomonstrate how to display a page after a visitor has chosen to leave your site.

THE SCHEME:
The backbone of this scheme is placing an onUnload event handler in the <frameset> tag of the frames lay-out page. As a visitor leaves your site the frameset is unloaded, triggering the event handler which calls a function that displays a Confirmation Box. At this point, clicking OK opens a new window and loads the appropriate page. Clicking CANCEL takes the visitor directly to where ever he was headed without openning a new window.

KNOWN DRAWBACKS:
  • Netscape 2.0x doesn't appear to support this scheme (an Alert Box is loaded instead of a page).
  • Hitting the RELOAD button unloads the frameset and triggers the Good-Bye sequence (any ideas?).

    WHY FRAMES:
    Placing the onUnload in the <frameset> tag allows you to load and unload pages within your site without triggering the exit signal. To test this out, click on the
    Internal Example Link now. You should see an example page load and then be allowed to return here, both without triggering the Good-Bye sequence.

    TRY IT OUT:
    All right, enough of the explanations already... let's see what this example is really about. To test this scheme, all you have to do is unload the frameset page. Try one or all of the following:
    • BACK BUTTON (be sure to back up until frames lay-out page is unloaded)
    • HOME BUTTON
    • RELOAD BUTTON
    • GO LIST
    • BOOKMARKS
    • CLOSE BROWSER
    • Timothy's JavaScript Examples


    View Source


    Displaying A Good-Bye Page
    by Tim Wallace
    timothy@essex1.com