javascript 如何判断刷新,关闭IE,关闭IE的选项卡
javascript 如何判断刷新,关闭IE,关闭IE的选项卡
------解决方案--------------------window.onunload=function(){ alert("窗口或浏览器被关闭"); }
------解决方案--------------------Code:
<html>
<script language="javascript">
window.onbeforeunload = function() //author: forefront
{
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 = "";
alert('close');
}
}
</script>