关闭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>  

转载于:https://www.cnblogs.com/Spring/archive/2006/10/25/539312.html

猜你喜欢

转载自blog.csdn.net/weixin_33843409/article/details/93932431