首頁 > 問答 > 主體
黄舟2017-05-19 10:34:10
1
2
3
4
5
<code>window.onbeforeunload=function(e){
<code>window.onbeforeunload=
function
(e){
e.returnValue = 'something'
e.returnValue =
'something'
console.log("为啥不能运行");
console.log(
"为啥不能运行"
);
return ;
return
;
}</code>
必須給事件的returnValue屬性綁定一個值,否則瀏覽器會直接關掉,就看不到console的輸出了
世界只因有你2017-05-19 10:34:10
雷雷