<head>
<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><param name="Command" value="Close">
</object>
</head>
<body>
<input type="button" value="关闭窗口" onclick="closes.Click();">
</body>
<OBJECT id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><param name="Command" value="Close">
</object>
</head>
<body>
<input type="button" value="关闭窗口" onclick="closes.Click();">
</body>
<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>
<PARAM NAME="Command" VALUE="close">
</OBJECT-->然后在你要关闭的页中加入这个button:
<input type="button" value="关闭" onclick="javascript:window.opener=window.name;window.close();" ID="Button1" NAME="Button1"> 绝对百分百解决问题!
若要兼容各种页子,则只能用阿信的代码了,http://www.csdn.net/Develop/Read_Article.asp?Id=19170