This example uses the HTML DOM to assign an "onbeforeunload" event to the window object.
Close this window, press F5 or click on the link below to invoke the onbeforeunload event.