卸載事件應該存在bug,一下有一個解決方法
這是我搜到的其中一個方法;
還有似乎alert,prompt,confirm等彈窗都無法生效。網上參考過來的!
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title> 卸載事件 </title>
<script type="text/javascript"> ?
? ? window.onbeforeunload=function(event){
? ? ? event.returnValue=false;
? ? }
</script> ?
</head>
<body>
? 歡迎學習JavaScript。
</body>
</html>