var sFeatures = "menubar=no,toolbar=no,location=no,status=no";
window.open("Index.asp", null, sFeatures);
window.opener = null;
window.close();

解决方案 »

  1.   

    var sFeatures = "menubar=no,toolbar=no,location=no,status=no";
    var aa=window.open("Index.asp", null, sFeatures);
    window.opener = null;
    aa.window.close();
      

  2.   

    to junguo(junguo): 事实摆在面前!to lbd8848(lbd):你的第一个回复只是加了分号?JS中有没分号都一样的!
            第二个回复与我的意思不同,我不是要在父窗口中关闭子窗口,而是在打开子窗口时就把父窗口给关闭了,现在是在要子窗口中关闭子窗口,本来是一个很简单的事情,但出现了奇怪的结果!
      

  3.   

    原窗口:
    <script language=JavaScript>
    window.location="index.asp";
    </script>
    <OBJECT Name=Clo type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
    <PARAM name="Command" value="Close">
    </OBJECT>新窗口:
    <input type="button" name="button" value="Close" class="button" onClick="window.close();">
      

  4.   


    <body  >
    <input type='button' onclick='var sFeatures = "menubar=no,toolbar=no,location=no,status=no";window.open("try2.htm", null, sFeatures);window.opener = null;window.close()'>
    </body>以上为try1.htm,下面为try2.htm<input type='button' onclick='window.close()'>我试过了,好使阿!检查一下你程序中的字符串大小写什么的!
      

  5.   

    看看你关闭新窗口的代码是不是写在新窗口的FRAME或IFRAME里了?我想一定是的!
    一般情况下window.close()就算关不了窗口也应有提示的,我试过在IFRAME里用window.close()就关不了,也不会有提示!
    如果是在代码是写在IFRAME里,请改写成top.window.close()或parent.window.close()
      

  6.   

    to kegumingxin(刻骨铭心): 是的,我的关闭代码就是在iframe页面里,换成top.window.close()就行了。太感谢了!!