document.onunload : onunload : Document JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » Document » onunload »

 

document.onunload












Syntax








onUnLoad="command"



The onUnLoad event is fired when the page is unloaded.

This occurs when the user leaves the page for another page.

This event handler actually belongs to the Window object but is accessible through the Document object.


The onunLoad event handler in the

of a document that is loaded in a frame will fire before an event loaded in the tag that loaded the document.











<html>
    <body onunload='alert("Please do not leave!")'>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo Document
» onunload