开发者

what is the difference between window.unload and window.onunload

I've tested both of them and they work as expected in Opera, IE, FF and Chrome. I've searched window.unload on google and https://developer.mozilla.org/en-US/search?q=window.unload but it didn't help much. What is the difference between them or window.unload is just the older v开发者_如何学JAVAersion of window.onunload?


window.onunload is event handler. When you, or user, call window.unload, the event is triggered and window.onunload is called. So you can redefine window.onunload any way you like to, for example, display a confirmation dialog before unloading, send some data to the server of whatever else.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜