IE关闭时判断及AJAX注销案例学习
代码如下:
<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>
相关推荐
80437916 2020-04-11
WinerChopin 2020-03-03
程序员俱乐部 2020-02-21
cfang00 2013-05-15
流年浅滩 2015-06-14
MaureenChen 2014-05-28
囧芝麻 2019-12-28
jjddrushi 2019-12-27
Safari浏览器 2019-12-23
Safari浏览器 2019-12-11
letheashura 2019-12-03
宇智波鼬 2014-01-20
89357940 2014-01-14
Teresasmida 2014-01-10
Congpanpan 2013-09-04
zljiaa 2019-11-19