diff --git a/entries/unload.xml b/entries/unload.xml index e7c12492..e33dc639 100644 --- a/entries/unload.xml +++ b/entries/unload.xml @@ -28,18 +28,16 @@

Any unload event handler should be bound to the window object:


 $( window ).unload(function() {
-  alert( "Handler for .unload() called." );
+  return "Handler for .unload() called.";
 });
     
-

After this code executes, the alert will be displayed whenever the browser leaves the current page. -It is not possible to cancel the unload event with .preventDefault(). This event is available so that scripts can perform cleanup when the user leaves the page. -

+

This event is available so that scripts can perform cleanup when the user leaves the page. Most browsers will ignore calls to alert(), confirm() and prompt() inside the event handler. The string you return may be used in a confirmation dialog, but not all browsers support this. It is not possible to cancel the unload event with .preventDefault().

To display an alert when a page is unloaded: