handler(eventObject)A function to execute when the event is triggered.
适用场景:
The unload event is sent to the window element when the user navigates away from the page. This could mean one of many things.
The user could have clicked on a link to leave the page, or typed in a new URL in the address bar. (用户点击一个离开页面的链接或者在地址栏重新键入一个新的地址)
The forward and back buttons will trigger the event.(点击前进 后退 按钮)
Closing the browser window will cause the event to be triggered. (关闭浏览器)
Even a page reload will first create an unload event.或者重新载入页面