捕获刷新事件

来源:互联网 发布:java package 编辑:程序博客网 时间:2024/05/17 04:47

function window.onbeforeunload() { if(event.clientX>document.body.clientWidth && event.clientY<0 || event.altKey) { alert(window.event.returnValue="你调用了script,但并没有刷新,而是关闭浏览器!"); }else { alert("你在刷新") } }

原创粉丝点击