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