<p>非正常退出考试页面:关闭浏览器、关闭页面提示</p>
<p>js监测关闭当前页面、关闭浏览器和取消监测</p>
<button onclick="unbindunload()">取消提示</button>
<!--非正常退出考试页面-->
<script>
window.onbeforeunload = function () {
return "退出?";
//return null;
};
//取消监测调用下面的方法
function unbindunload() {
window.onbeforeunload=null;//取消事件绑定
}
</script>
js监测关闭当前页面、关闭浏览器和取消监测
最新推荐文章于 2024-03-19 10:15:01 发布