goody9807
<script   language="JavaScript">   
  
<!--   
  
function   myexit()   
  
{   
  
//   do   anything   
  return   "测试关闭事件页面";   
  }
   
  
//-->   
  </script>   
  </head>   
    
  
<body   bgcolor="#FFFFFF"   text="#000000"   onbeforeunload="event.returnValue=myexit()">   

刷新时不触发网页退出事件   
  
<script   language=javascript>   
  
function   window.onbeforeunload()   
  
{   
      
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)   
      
{   
          window.event.returnValue
="确定要退出本页吗?";   
      }
   
  }
   
  
</script>

分类:

技术点:

相关文章:

  • 2021-09-09
  • 2022-01-09
  • 2021-11-24
  • 2021-05-30
  • 2021-11-11
  • 2021-12-09
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-08-28
  • 2022-12-23
  • 2021-11-27
  • 2021-11-26
  • 2021-10-13
相关资源
相似解决方案