布丁足迹

千里始足下,高山起微尘,吾道亦如此,行之贵日新。

js关闭当前窗口代码

onclick="windows.close();"   也行,不过下面的兼容性好点。
 
<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>
更多
« ie6高设1像素解决方法超级强的PS绘图高手! »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

黄金广告位求包养

最会抢沙发的淫

宣传推广栏

完全随机文章

最新评论及回复

最近留言

Powered By Z-Blog 1.8 Walle Build 100427

[过度上网,有害健康]    感谢诚网科技提供空间
版权所有 © 2007-2010 布丁足迹 辽ICP备08100443号

你敢来踩,我就敢回踹