Section 25.308. Window.onunload: the handler invoked when the browser leaves a page


25.308. Window.onunload: the handler invoked when the browser leaves a page

DOM Level 0:

25.308.1. Synopsis

 Function onunload 

25.308.2. Description

The onunload property of a Window specifies an event-handler function that is invoked when the browser "unloads" a document in preparation for loading a new one.

The initial value of this property is a function that contains the semicolon-separated JavaScript statements specified by the onunload attribute of the <body> or <frameset> tags.

The onunload event handler enables you to perform any necessary cleanup of the browser state before a new document is loaded.

The onunload( ) handler is invoked when the user has instructed the browser to leave the current page and move somewhere else. Therefore, it is usually inappropriate to delay the loading of the desired new page by popping up dialog boxes (with Window.confirm( ) or Window.prompt( ), for example) from an onunload event handler.

25.308.3. See Also

Window.onload; Chapter 17




JavaScript. The Definitive Guide
JavaScript: The Definitive Guide
ISBN: 0596101996
EAN: 2147483647
Year: 2004
Pages: 767

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net