DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> 關於JavaScript >> IE關閉時判斷及AJAX注銷案例學習
IE關閉時判斷及AJAX注銷案例學習
編輯:關於JavaScript     
復制代碼 代碼如下:
<script language="javascript">
window.onbeforeunload = function () {
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth - 20;
if (b && window.event.clientY < 0 || window.event.altKey) {

try {
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("POST", "LogOut.aspx", false);
xmlhttp.send();
//return true;
}
catch (e) {
alert('delete user account error message:' + e.message);
}

//return "你確定要退出系統嗎?退出請按'離開此頁'";
} else {
//alert("是刷新而非關閉");
}
}

</script>
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved