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

安全基础
手机病毒的分类及其防范措施
如何防止黒客远程盗取QQ密码
始料未及,谁在控制电脑重新启动
网络常见木马的手工清除方法
防火墙日志记录让蠕虫病毒无处可逃
魔高一尺 道高一丈
提防他人动用电脑另有妙招
Linux受攻击次数高于Windows
Cookie的传递流程及安全问题
安全配置Norton Security2004
查看系统中是否有简单木马
Windows超长共享名溢出漏洞
封杀Windows XP的共享漏洞
网络世界的“后门”—讲述特殊端口的故事
快速干掉感染Internet Explorer的恶意程序
菜鸟入门常用的八种安全工具使用及防御方法
QQ帮你突破网吧硬盘访问限制
邮件安全攻略:只要糖衣不要炮弹
局域网内盗用IP的安全问题
隐藏卸载信息:跟入侵者玩躲猫猫游戏

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-10-28   浏览: 71 ::
收藏到网摘: 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>