function window.onbeforeunload() { if(event.clientX>document.body.clientWidth && event.clientY<0 || event.altKey) { alert(window.event.returnValue="你调用了script,但并没有刷新,而是关闭浏览器!"); }else { alert("你在刷新") } }
捕获刷新事件
最新推荐文章于 2022-04-18 00:39:55 发布
function window.onbeforeunload() { if(event.clientX>document.body.clientWidth && event.clientY<0 || event.altKey) { alert(window.event.returnValue="你调用了script,但并没有刷新,而是关闭浏览器!"); }else { alert("你在刷新") } }