Skip to content

Commit 3f0ff89

Browse files
committed
Unload: update outdated example
1 parent 860f822 commit 3f0ff89

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

entries/unload.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
<p>Any <code>unload</code> event handler should be bound to the <code>window</code> object:</p>
2929
<pre><code>
3030
$( window ).unload(function() {
31-
alert( "Handler for .unload() called." );
31+
return "Handler for .unload() called.";
3232
});
3333
</code></pre>
3434
<p>After this code executes, the alert will be displayed whenever the browser leaves the current page.
@@ -39,7 +39,7 @@ It is not possible to cancel the <code>unload</code> event with <code>.preventDe
3939
<desc>To display an alert when a page is unloaded:</desc>
4040
<code><![CDATA[
4141
$( window ).unload(function() {
42-
alert( "Bye now!" );
42+
return "Bye now!";
4343
});
4444
]]></code>
4545
</example>

0 commit comments

Comments
 (0)