var _t; window.onbeforeunload = function(){ closeTime(); setTimeout(function(){_t = setTimeout(onunloadcancel, 0)}, 0); return "真的离开?"; } window.onunloadcancel = function(){ clearTimeout(_t); //alert("取消离开"); }
本文共 311 字,大约阅读时间需要 1 分钟。
var _t; window.onbeforeunload = function(){ closeTime(); setTimeout(function(){_t = setTimeout(onunloadcancel, 0)}, 0); return "真的离开?"; } window.onunloadcancel = function(){ clearTimeout(_t); //alert("取消离开"); }
转载于:https://www.cnblogs.com/macliu/p/4019514.html