Binds a function to the unload event of each matched element.
Arguments:
| fn | Function | |
|---|---|---|
function to bind to the unload event on each of the matched elements.
function callback(eventObject) {
this; // dom element
}
| ||
To display an alert when a page is unloaded:
$(window).unload( function () { alert("Bye now!"); } );