js 监控浏览器关闭事件


  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>

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM