浏览器关闭事件


<body onbeforeunload="onCloseIe();">



<script type="text/javascript">

function onCloseIe() {

//关闭整个浏览器
if (window.event) {
var n = window.event.screenX - window.screenLeft;
var b = n > document.documentElement.scrollWidth - 20;
if (event.clientX > document.body.clientWidth && event.clientY < 0
|| event.altKey) {
checkChatRoom('localhost','8080',$('#uid').val(),'logout');
}
}

}

</script>

你可能感兴趣的:(浏览器)