捕捉窗口的关闭与刷新

<script language="javascript">
<!--
var s="close";
function window.onunload(){
  
   if(s=="fresh")
      if(window.screenLeft>10000){alert('关闭');}else{alert('刷新');}
   else
      alert('关闭');
}
function window.onbeforeunload(){
   s="fresh";
}
-->
</script>
 

你可能感兴趣的:(捕捉窗口的关闭与刷新)