<html>
<head>
<meta http-equiv="Content-Language" content="en" />
<meta name="GENERATOR" content="Zend Studio" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>title</title>
<script type="text/javascript">env ="close";
window.onbeforeunload = function ()
{
env = "fresh"; # FireFox 下总会被触发
}
window.onunload = function(){ if(env=="fresh")
{
if(navigator.userAgent.indexOf("MSIE")>0)
{
if(window.screenLeft >10000){
alert('关闭');
}else{
alert('刷新');
}
}
if(isFirefox=navigator.userAgent.indexOf("Firefox")>0){
var clHeight = document.body.clientHeight;
if(clHeight == 0){
alert('关闭');
}else{
alert('刷新'); # FireFox 在关闭主窗口时也会触发这个-_-!
}
}
}else{
alert('关闭');
}
}
</script>
</head>
<body>
test
</body>
</html>这是一个古老的问题………………
而且没人完美解决……