在主窗口关闭操作时加
子窗口名.close()

解决方案 »

  1.   

    js只可以关闭自己和与自己有关联的窗口(自己打开的窗口或打开自己的窗口),把玩单独打开的窗口js是不能关闭的,它们都是独立的一个窗口!
      

  2.   

    给你整页的代码吧,我刚好也在做这个
    <html>
    <head>
    <title>无标题文档</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body scroll=no leftmargin=0 topmargin=0 valign=top oncontextmenu="return false;">
    <OBJECT id="min" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
    <PARAM name="Command" value="Minimize"></OBJECT>
    <script>
    var openwinflag;
    function freezwy()
    {
         openwinflag=window.open(top.location,'freezwy_tj','fullscreen=0,toolbar=no,scrollbars=no,resizable=1,menubar=no');
        window.focus();
        document.min.Click();
    }
    if(window.name != "freezwy_tj")
    {
      freezwy();
      openwinflag.resizeTo(800,600);
         openwinflag.moveTo(0,0);
    }function closewin()
    {
       openwinflag.close();
      self.close();
     }
    </script>
    <input type="button" name="Submit" value="关闭" onclick="closewin()">
    </body>
    </html>