<html>
<head>
<title>直接关闭IE浏览器</title>
</head>
<body>
<OBJECT classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 id=WB width=0></OBJECT>
<input type="button" value="直接关闭" onclick="WB.ExecWB(45,1)">
<input type="button" value="一般的关闭窗口" onclick="window.close();">
</body>
</html>

解决方案 »

  1.   

    to  weidegong(weidegong):为什么在5.0版本上会出现那个对话框呢?你的那个代码我运行了一下,点击“直接关闭”会有错误的。
    你就直接告诉我你是怎么“直接关闭”那个窗口的?谢谢了。
      

  2.   

    窗口a 弹出窗口b.
    在窗口b操作。
    将结果显示在窗口a.然后将自己(b)关掉。
    这样可以避免你说的问题。
      

  3.   

    mindd(呆头鼠) :没办法了。5.0我没装,没有测试。
      

  4.   

    用window.document.self.close;
    就不会有对话框了
      

  5.   

    to redsnakecao(曹):
       
       那个代码你以前用过吗?好像不行呀。
      

  6.   

    window.document.self.close()
    再试试
      

  7.   

    to redsnakecao(曹):   还是不行!程序一点反应都没有,就停在那个Log画面上了。   你试试看!
      

  8.   

    Invoking the window.close method on a window not opened with script will display a confirmation dialog box. Using script to close the last running instance of Microsoft&reg; Internet Explorer also opens the confirmation dialog box. 意思是,如果在不是用脚本打开的窗口中调用window.close ,则会有对话框;关闭ie的最后一个实例也会有对话框。很明显,你要关闭的窗口应该用脚本打开。
      

  9.   

    我已测试通过,ie5,ie5.5都可以。
      

  10.   

    to coinicon(硬壳猪):   但是我要关闭的窗口不是用window.open 打开的,是启动IE输入URL打开的。所以...... 没有办法了。不能交差了,只能砍掉这个功能了。  :(