<script language=javascript>
function window.onbeforeunload()
{
if (typeof evt == 'undefined') {
evt = window.event;
}
if (evt) {
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey){
// 这个可以排除刷新 关闭的时候触发
window.onunload = function() {
window.location.href = "../logout.jsp";
}
}
}
}
</script>
我试了试好像也是不行啊
<script language=javascript>
function window.onbeforeunload()
{
if(event.clientX>document.body.clientWidth&&event.clientY<0||event.altKey)
{
var xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.open("GET","logout.jsp",false);
xmlhttp.send();
}
}
</script>
蓝山帝景
慕婉清6462132
牛魔王的故事
相关分类