如何通过单击关闭按钮或页面刷新或通常导致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)
请帮我.