window.onbeforeunload=function (){
alert("===onbeforeunload===");
if(event.clientX>document.body.clientWidth && event.clientY < 0 || event.altKey){
alert("你关闭了浏览器");
代码…………
}else{
alert("你正在刷新页面");
}
}
本地 IE8 运行正常,放到网站上,IE6 运行不起作用……。求解……
或用其它方法 检测到IE 关闭浏览器时,并只在关闭浏览器时执行此代码,刷新时不执行……
alert("===onbeforeunload===");
if(event.clientX>document.body.clientWidth && event.clientY < 0 || event.altKey){
alert("你关闭了浏览器");
代码…………
}else{
alert("你正在刷新页面");
}
}
本地 IE8 运行正常,放到网站上,IE6 运行不起作用……。求解……
或用其它方法 检测到IE 关闭浏览器时,并只在关闭浏览器时执行此代码,刷新时不执行……
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货