网页关闭事件

onbeforeunload事件刷新和跳转页面都会触发,弹出框只能是浏览器自带的,不能自定义弹窗,alert、confirm在里面都不起作用

window.onbeforeunload=function(e){
              var e = window.event||e;
              e.returnValue=("离开吗?");
            }

猜你喜欢

转载自blog.csdn.net/qq_36061522/article/details/83061517