[Contents] [Previous] [Next] [Index]

onUnload

Executes JavaScript code when an unload event occurs; that is, when the user exits a document.

Event handler for

Window

Implemented in

Navigator 2.0

Syntax

onUnload="handlerText"

Parameters

handlerText
JavaScript code or a call to a JavaScript function.

Description

Use onUnload within either the BODY or the FRAMESET tag, for example, <BODY onUnload="...">.

In a frameset and frame relationship, an onUnload event within a frame (placed in the BODY tag) occurs before an onUnload event within the frameset (placed in the FRAMESET tag).

Event properties used

type
Indicates the type of event.

target
Indicates the object to which the event was originally sent.

Examples

In the following example, onUnload calls the cleanUp function to perform some shutdown processing when the user exits a Web page:

<BODY onUnload="cleanUp()">

See also

onLoad

For general information on event handlers, see "General Information about Events".

For information about the event object, see event.



[Contents] [Previous] [Next] [Index]

Last Updated: 10/31/97 16:34:02


Copyright � 1997 Netscape Communications Corporation