<div class="codetitle"> <span><a style="CURSOR: pointer" data="872" class="copybut" id="copybut872" onclick="doCopy('code872')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code872"> <br><script language="javascript"> <BR>window.onbeforeunload = function () { <BR>var n = window.event.screenX - window.screenLeft; <BR>var b = n > document.documentElement.scrollWidth - 20; <BR>if (b && window.event.clientY < 0 || window.event.altKey) { <br><br>try { <BR>var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP"); <BR>xmlhttp.open("POST", "LogOut.aspx", false); <BR>xmlhttp.send(); <BR>//return true; <BR>} <BR>catch (e) { <BR>alert('delete user account error message:' + e.message); <BR>} <br><br>//return "你确定要退出系统吗?退出请按'离开此页'"; <BR>} else { <BR>//alert("是刷新而非关闭"); <BR>} <BR>} <br><br></script> <br> </div>