会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
横十条
许多时候,人们并非败于对手的竞争,而是败在自己的狭隘
博客园
首页
新随笔
联系
管理
订阅
2018年4月11日
JS在即将离开当前页面(刷新或关闭)时触发事件
摘要: // onbeforeunload 事件在即将离开当前页面(刷新或关闭)时触发 window.onbeforeunload = function () { return /^\#\/ipinfo/.test(location.hash) || /^\#\/ipdetail/.test(location.hash) ? '您正处于编辑状态,确认离开该页面么?' : null; }; ...
阅读全文
posted @ 2018-04-11 18:15 横十条
阅读(1129)
评论(0)
推荐(0)
编辑
公告