only when the window is opened by then script.window.opener=null
window.close();//for ie5.5+

解决方案 »

  1.   

    因为你的窗口不是用window.open打开的,所以就出现这种情况!
      

  2.   

    ie6.0(非sp1)直接用<a>标签打开的新窗口(_blank)的超链接可以直接window.close()有谁能测试一下ie5.0和ie5.5就是直接window.close(),ie6下pass,不是用window.open()打开的新窗口
      

  3.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>CloseWindow</title>
    </head>
    <OBJECT id=WebBrowser classid=CLSID:8856F961-340A-11D0-A96B-00C04FD705A2 height=0 width=0></OBJECT>
    <body>
    <script>document.all.WebBrowser.ExecWB(45,1)</script>
    </body>
    </html>