window.opener = null;
window.close();

解决方案 »

  1.   

    关闭窗口无提示的总结:
    http://community.csdn.net/Expert/topic/3358/3358489.xml?temp=.6051752
      

  2.   

    <script language="javascript">
    <!--
      window.setTimeout('window.opener=null;window.close();',3000)
    //-->
    </script>
      

  3.   

    <object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
    </object>
    <input type="button" name="Button" value="关闭窗口" onClick="document.all.WebBrowser.ExecWB(45,1)">
      

  4.   

    <object id="WebBrowser" width=0 height=0 classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2">
    </object>
    <input type="button" name="Button" value="关闭窗口" onClick="document.all.WebBrowser.ExecWB(45,1)">试着改变参数会得到其他一些功能:WebBrowser.ExecWB(1,1) 打开
    WebBrowser.ExecWB(2,1) 关闭现在所有的IE窗口,并打开一个新窗口
    WebBrowser.ExecWB(4,1) 保存网页
    WebBrowser.ExecWB(6,1) 打印
    WebBrowser.ExecWB(7,1) 打印预览
    WebBrowser.ExecWB(8,1) 打印页面设置
    WebBrowser.ExecWB(10,1) 查看页面属性
    WebBrowser.ExecWB(15,1) 好像是撤销,有待确认
    WebBrowser.ExecWB(17,1) 全选
    WebBrowser.ExecWB(22,1) 刷新
    WebBrowser.ExecWB(45,1) 关闭窗体无提示
      

  5.   

    <object id=closes type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
    <param name="Command" value="Close">
    </object>
    <a href="#" onclick="closes.Click();" title="关闭窗口">关闭窗口</a>
      

  6.   

    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>新建网页 1</title>
    </head><body onLoad="setTimeout('CloseWin()',300000)">>
    <script language="JavaScript">
      //setTimeout('opener=null;window.close();',3000);
    </script>lllll<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()
    }
    }
    function queclose()
    {
    if(confirm("你确定关闭吗?"))
    CloseWin();
    }
    //-->
    </script>
    <input type="button" onclick="queclose()" value="关闭">
    </body>
    </html>
      

  7.   

    window.opener = null;
    window.close();