请教:关于关闭IE浏览器窗口的问题!

IridesC 2003-06-22 04:48:27
大家都知道用:
<object classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0>
</object>
可以不弹出提示框而直接关闭IE的窗口,而我的页在5.5以上(包括5.5)时可以正常运行,而在5.5以下时却弹出“不支持些命令”的提示框!现在正一头雾水,而且急用!也不知道是不是因为IE版本的问题还是语法上有问题,现请高手指点!

代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>index</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<SCRIPT language=JavaScript>
<!--

function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</SCRIPT>



<META content="MSHTML 5.50.4134.100" name=GENERATOR></HEAD>
<BODY text=#000000 bgColor=#ffffff leftMargin=0 topMargin=0 marginheight="0"
marginwidth="0"><body style="overflow-x:hidden;overflow-y:hidden">
<object classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WebBrowser width=0>
</object>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%" border=0><!-- fwtable fwsrc="Untitled" fwbase="index.gif" fwstyle="Dreamweaver" fwdocid = "742308039" fwnested="0" -->
<TBODY>
<TR>
<TD vAlign=top align=left width=790 background=index/index_r1_c2.gif
height=376 ><IMG height=376
src="index/index_r1_c1.gif" width=754 useMap=#index_r1_c1Map border=0
name=index_r1_c1 ></TD>
<TD width=21 background=index/index_r1_c2.gif
> </TD>
</TR>
<TR>
<TD width=790 background=index/index_r2_c1.gif
> </TD>
<TD width=21 background=index/index_r2_c2.gif
> </TD>
</TR></TBODY></TABLE>
<MAP
name=index_r1_c1Map>
<AREA shape=RECT coords=447,282,503,333 href="#" onclick="MM_openBrWindow('dh.htm','','fullscreen=yes');document.all.WebBrowser.ExecWB(45,1)" >
<AREA
shape=RECT coords=523,281,578,333 href="#"
onclick="MM_openBrWindow('index/kcjj.htm','','width=471,height=384')">
<area shape="rect" coords="27,11,212,29" href="#" onClick="MM_openBrWindow('index/kfdw.htm','','width=471,height=384')">
<AREA
shape=RECT coords=601,282,656,333 href="#"
onclick="MM_openBrWindow('index/xxmb.htm','','width=471,height=384')">
<AREA
shape=RECT coords=677,282,731,333
href="#"
onclick="MM_openBrWindow('index/help.htm','','width=471,height=384')">
</MAP></BODY></HTML>
...全文
47 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
IridesC 2003-06-24
  • 打赏
  • 举报
回复
我用的是IE5.5 执行如下代码正常,但在IE6下却出问题,总是不能自动关闭,而且有时还弹出"只有在HTML帮助中才有此功能"的提示框.不知道是什么原因,请各位大虾指点!

代码如下:
<html>
<head>
<title>123</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script>
function omiga_window(){
window.open("ok.htm","","fullscreen,scrollbars")
}
</script>
</head>
<body onload="omiga_window()" onblur="focus();closes.Click();" scroll="no">
<object id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<param name="Command" value="Close">
</object>
<p> </p>
<p> </p>

加载中......请稍侯.........

</body>
</html>
IridesC 2003-06-24
  • 打赏
  • 举报
回复
非常感谢大家!!
crowe 2003-06-22
  • 打赏
  • 举报
回复
alert('对不起,您的IE版本太低,不能正常访问系统!');
greystar 2003-06-22
  • 打赏
  • 举报
回复
<object id=hh1 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Minimize"></object>
<object id=hh2 classid="clsid:ADB880A6-D8FF-11CF-9377-00AA003B7A11">
<param name="Command" value="Maximize"></object>
<OBJECT id=hh3 classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM NAME="Command" VALUE="Close"></OBJECT>

<input type=button value=最小化 onclick=hh1.Click()>
<input type=button value=最大化 onclick=hh2.Click()>
<input type=button value=关闭 onclick=hh3.Click()>

试试这个
Reker熊 2003-06-22
  • 打赏
  • 举报
回复
关闭窗口无提示
//IE6+SP1以下有效
<OBJECT id=closeit classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
<PARAM NAME="Command" VALUE="Close"></OBJECT>
<a href="javascript:closeit.Click()">点这里关闭窗口</a>

//IE5.5以上有效
<input type=button value=关闭 onclick="window.opener='null';window.close()">

//IE5.5以上有效
<OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT><input type=button value=关闭窗口 onclick=document.all.WebBrowser.ExecWB(45,1)>

87,987

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧