onBeforeUnload

This event handler will execute the instruction(s) when the page is about to be unloaded from a window or a frame.

syntax:

document.onBeforeUnload = function()

The onBeforeUnload Event Handler is used with the following:

BODY
FRAMESET
TD
TEXTAREA
TH
window