unload
UK[??n?l??d] US[??n?lo?d]
vt. Unload; remove burden; pour; process, dump
vi. To unload goods or other burdens; to unload bullets; [Business] to sell (securities)
jquery unload method syntax
Function:When the user leaves the page, the unload event will occur. Specifically, the unload event is emitted when: A link that leaves the page is clicked. A new URL is typed in the address bar. The browser is closed using the forward or back buttons. The page is reloaded. The unload() method places the event handler in the event handler. Bind to the unload event. The unload() method only applies to window objects.
Syntax: event.unload(function)
Parameters:
Parameters | Description |
function | Required. Specifies the function to run when the unload event is triggered. |
jquery unload method example
<html> <head> <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.1/jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function(){ $(window).unload(function(){ alert("再見!"); }); }); </script> </head> <body> <p>當您點擊 <a href="http://php.cn">這個鏈接</a> 時,或者關閉窗口,會觸發(fā)一個警告框。</p> </body> </html>
Click the "Run instance" button to view the online instance