// onbeforeunload 事件在即将离开当前页面(刷新或关闭)时触发
window.onbeforeunload = function () {
return /^\#\/ipinfo/.test(location.hash) || /^\#\/ipdetail/.test(location.hash) ? '您正处于编辑状态,确认离开该页面么?' : null;
};
// onbeforeunload 事件在即将离开当前页面(刷新或关闭)时触发
window.onbeforeunload = function () {
return /^\#\/ipinfo/.test(location.hash) || /^\#\/ipdetail/.test(location.hash) ? '您正处于编辑状态,确认离开该页面么?' : null;
};
转载于:https://www.cnblogs.com/liuyanpeng/p/8797485.html