复制代码 代码如下:
<!DOCTYPE html>
<html>
<head>
<script>
function closeIt()
{
return "Any string value here forces a dialog box to n" +
"appear before closing the window.";
}
window.onbeforeunload = closeIt;
</script>
</head>
<body>
<a href="http://www.uoften.com">Click here to navigate to
www.uoften.com</a>
</body>
</html>
兼容FF,IE,Chrome的js离开或刷新页面检测,关键的部分是要有return
最后
以上就是忧虑墨镜最近收集整理的关于js离开或刷新页面检测(且兼容FF,IE,Chrome)的全部内容,更多相关js离开或刷新页面检测(且兼容FF内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复