高手如题!目前我用的方法只实现了关闭整个浏览器后能退出系统清空用户,但是关闭标签页面起不到系统退出并清空用户的作用!我的写法如下:
<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)
{
//alert("是关闭而非刷新");
// window.event.returnValue = "您确定要退出系统?";
if(confirm("您确定要退出系统?")){
window.location = "logout.do";
}else{
return false;
}
}else{
//alert("是刷新而非关闭");
}
}
</script>
请问各位高手是否可以指点一二啊!
<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)
{
//alert("是关闭而非刷新");
// window.event.returnValue = "您确定要退出系统?";
if(confirm("您确定要退出系统?")){
window.location = "logout.do";
}else{
return false;
}
}else{
//alert("是刷新而非关闭");
}
}
</script>
请问各位高手是否可以指点一二啊!
这个东西明明就不能准确捕捉到的,就tmd苦了我们这些代码民工