小编ian*_*ian的帖子

如何识别onbeforeunload是由单击关闭按钮引起的

如何通过单击关闭按钮或页面刷新或通常导致onbeforeunload导致的事件来确定是否导致onbeforeunload?

这是一个片段:

window.onbeforeunload = function( e ){
    if( !e ) e = window.event;

    // insert code to determine which is the source of the event
}
Run Code Online (Sandbox Code Playgroud)

请帮我.

javascript internet-explorer onbeforeunload

4
推荐指数
1
解决办法
4887
查看次数