代码如下:

<!DOCTYPE html>
<html>
    <head>
        <title>监控浏览器关闭事件</title>
    </head>
    <style type="text/css">
    </style>
    <body>
        <div >
        </div>
    </body>
</html>
<script type="text/javascript">
    var widowClose = {};
    widowClose.tip = "浏览器即将关闭,是否确定??";
    widowClose.set = function(a) {
        window.onbeforeunload = function(b) {
            b = b || window.event;
            b.returnValue = a;
            return a
        }
    };
    widowClose.clear = function() {
        fckDraft.delDraftById();
        window.onbeforeunload = function() {
        }
    };
    widowClose.set(widowClose.tip);
</script>

 

相关文章:

  • 2021-04-10
  • 2021-12-06
  • 2021-12-06
  • 2021-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-09-04
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案