Event.UNLOAD

JavaScript 1.0+, JScript 1.0+ Nav2+, IE 3+, Opera3+ Syntax

Event.UNLOAD

Description

The UNLOAD property of the Event object is used by documents to indicate when a new document is loaded in a browser or when the browser window is closed.

Example

Listing 7.239 shows how the UNLOAD property can be used to find out when a browser has finished unloading a Web page. When the UNLOAD event has been captured, the handle() function is called, which informs the user that the page has been unloaded.

Listing 7.239 Accessing the UNLOAD Property
 <html> <head> <title>Using the Event.UNLOAD</title> </head> <body> <script language = "JavaScript"> <!--Hide // sets up the window to capture UNLOAD events window.captureEvents(Event.UNLOAD); ...

Get Pure JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.