码迷,mamicode.com
首页 > Web开发 > 详细

js 监控浏览器关闭事件

时间:2019-12-03 20:03:21      阅读:118      评论:0      收藏:0      [点我收藏+]

标签:span   事件   oct   ext   text   fun   asc   event   htm   

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>监控浏览器关闭事件</title>
  5. </head>
  6. <style type="text/css">
  7. </style>
  8. <body>
  9. <div id="create_order">
  10. </div>
  11. </body>
  12. </html>
  13. <script type="text/javascript">
  14. var widowClose = {};
  15. widowClose.tip = "浏览器即将关闭,是否确定??";
  16. widowClose.set = function(a) {
  17. window.onbeforeunload = function(b) {
  18. b = b || window.event;
  19. b.returnValue = a;
  20. return a
  21. }
  22. };
  23. widowClose.clear = function() {
  24. fckDraft.delDraftById();
  25. window.onbeforeunload = function() {
  26. }
  27. };
  28. widowClose.set(widowClose.tip);
  29. </script>

 

js 监控浏览器关闭事件

标签:span   事件   oct   ext   text   fun   asc   event   htm   

原文地址:https://www.cnblogs.com/nxmxl/p/11978632.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!