<script type="text/javascript">
  window.onbeforeunload = function(event) {//event写不写都无所谓    这里也可用其他方法操作    执行前提是页面有过修改

          document.getElementById('dd').innerHTML="W3Cschool";//关闭页面这句会执行  firefox 以及 Microsoft Edge可以
      return "数据保存中...";//return必须要
  }

.......

 

<body>
    <p ></p>

......

关闭页面前提示或保存数据关闭页面前提示或保存数据

相关文章:

  • 2021-10-29
  • 2022-02-13
  • 2021-05-29
  • 2022-12-23
  • 2022-01-18
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-12-22
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
相关资源
相似解决方案