关闭IE窗口时执行事件

<script language="javascript">
 //关闭窗口时自动退出
 function  window.onbeforeunload(){
  if(event.clientX>360&&event.clientY<0||event.altKey){  
   //alert("dddddddddd");
   Logout();
  }  
 }  
 function  Logout(){  
     try{  
     xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");  
     }catch(e){  
     xmlHttp = new XMLHttpRequest();  
     }  
     //数据传输,flase为非异步方式
     xmlHttp.open("post","enter.asp?Active=Logout",true);  
     xmlHttp.send(null);  
 }  
</script>  

posted on 2006-10-25 11:49  Eric Zhang  阅读(2766)  评论(0编辑  收藏  举报

导航