js检测页面离开

window.location = 'yjk://app.h5.ihaozhuo.com?page=livetrailer&videoLiveId=' + parseInt(this.Request.id);
var timer = setTimeout(function(){
location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.ihaozhuo.youjiankang&g_f=991653';
}, 1000);
document.addEventListener('visibilitychange', function() {
var tag = document.hidden || document.webkitHidden;
if (tag) {
clearTimeout(timer);
}
})
document.addEventListener('pagehide', function() {
clearTimeout(timer);
})
上一篇:ASP.NET Core 运行原理剖析


下一篇:OD之去除nag弹窗(四)