window.onbeforeunload = function close()
{ temp=0;
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth-20;
if(b && window.event.clientY < 0 || window.event.altKey)
{
window.event.returnValue = "退出登录?"; //这里可以放置你想做的操作代码
temp=1;
}
}
window.close();
$(window).unload(function () {
alert("关闭");
})