onbeforeunload事件刷新和跳转页面都会触发,弹出框只能是浏览器自带的,不能自定义弹窗,alert、confirm在里面都不起作用
window.onbeforeunload=function(e){
var e = window.event||e;
e.returnValue=("离开吗?");
}
onbeforeunload事件刷新和跳转页面都会触发,弹出框只能是浏览器自带的,不能自定义弹窗,alert、confirm在里面都不起作用
window.onbeforeunload=function(e){
var e = window.event||e;
e.returnValue=("离开吗?");
}