DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> JavaScript基礎知識 >> js 監控浏覽器關閉事件
js 監控浏覽器關閉事件
編輯:JavaScript基礎知識     

代碼如下:

<!DOCTYPE html>
<html>
    <head>
        <title>監控浏覽器關閉事件</title>
    </head>
    <style type="text/css">
    </style>
    <body>
        <div id="create_order">
        </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>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved