撲捉瀏覽器關閉事件

<script for="window" event="onbeforeunload">
var n = window.event.screenX - window.screenLeft;
    var b = n > document.documentElement.scrollWidth-20;
    //document.body.clientWidth-event.clientX<15
if (b&&event.clientY< 0||event.altKey)
{
   top.location.href="exit.jsp";//當瀏覽器關閉時,執行exit.jsp頁面
     //window.event.returnValue="關閉窗口將停止所有會話!";
   //window.event.returnValue=""; 頁面提示
}    
</script>

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章