window.onbeforeunload=function (){
 alert("===onbeforeunload===");
 if(event.clientX>document.body.clientWidth && event.clientY < 0 || event.altKey){
      alert("你关闭了浏览器");
      代码…………
 }else{
      alert("你正在刷新页面");
 }
 }
本地 IE8 运行正常,放到网站上,IE6 运行不起作用……。求解……
或用其它方法 检测到IE 关闭浏览器时,并只在关闭浏览器时执行此代码,刷新时不执行……