获取IE的close 事件,包括点右上角的叉
<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)
{
window.event.returnValue = ""; //这里可以放置你想做的操作代码
}
}
</script>
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)
{
window.event.returnValue = ""; //这里可以放置你想做的操作代码
}
}
</script>