当前位置: 首页 > 图文教程 > 网络安全 > 安全基础 > 完美关闭窗口JS

安全基础
在Win2000中预防Ping攻击
管理点对点的Windows网络
防范木马和黑客 保护QQ安全
浅谈黑客入侵的4条途径
十大入侵检测系统高风险事件及其处置对策
打造Win2K服务器的安全盾牌
利用交换机防范蠕虫病毒的入侵
冲浪DDoS攻击的趋势与防御
防DDoS攻击11招
无线网络安全五戒
无线网络,你的数据安全吗?
为什么应该更重视无线网络安全性
Windows XP无线网络安全精解
最大限度保护无线网络安全的六项措施
企业的无线安全问题
无线局域网安全攻略
WLAN安全吗?
WLAN的10大安全“秘笈”
保护WLAN中的数据
无线局域网的安全困惑

安全基础 中的 完美关闭窗口JS


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-28   浏览: 86 ::
收藏到网摘: n/a

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
<!--
by fason(2003-5-20)
-->
</head>
<body>
<script language="JavaScript">
<!--
function CloseWin()
{
var ua=navigator.userAgent
var ie=navigator.appName=="Microsoft Internet Explorer"?true:false
if(ie){
    var IEversion=parseFloat(ua.substring(ua.indexOf("MSIE ")+5,ua.indexOf(";",ua.indexOf("MSIE "))))
 if(IEversion< 5.5){
    var str  = ’<object id=noTipClose classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">’
    str += ’<param name="Command" value="Close"></object>’;
    document.body.insertAdjacentHTML("beforeEnd", str);
    document.all.noTipClose.Click();
    }
    else{
    window.opener =null;
    window.close();
    }
}
else{
window.close()
}
}
//-->
</script>
<input type=button value=关闭 onclick="CloseWin()">
</body>
</html>