你要实现什么呢?是不是把两个窗口都关掉,在IE7中如果不想有提示的话
可以使用open,下面的方法兼容IE6和7
<script language=javascript>
    window.opener=null;
    window.open("","_self");
    window.close();
</script>

解决方案 »

  1.   

    但是我打开的时候,需要带窗口的长度,宽度之类的参数怎么带进去?
    在线等,谢谢<html>
    <title>asdasd</title>
    <script type="text/javascript"> 
    function CloseWin() //

    window.opener=null;
    window.open("indexen.asp",width=400,height=300,toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,copyhistory=no,resizable=no,"_self");
    window.close(); 
    }
    </script>
    <body>asdasdasdasd
    <input type = "button" value = "Close" onclick = "CloseWin();alert('ok');">
    </body></html>这个样子根本关不了呀
      

  2.   

    <html>
    <title>asdasd</title>
    <script type="text/javascript"> 
    function CloseWin() //

    window.opener=null;
    window.open("test1.asp","_self");
    window.close(); 
    }
    </script>
    <body>asdasdasdasd
    <input type = "button" value = "Close" onclick = "CloseWin();alert('ok');">
    </body></html>这样也不行
      

  3.   

    //已经测试,两个页面都可以关掉的<script language=javascript>
          newwin   =   window.open( "1.htm", "", "这里写参数"); 
          newwin.close()
          window.opener==null
          window.open("","_self")
          window.close(); 
    </script>
      

  4.   

    晕,光测IE7了,IE6下没测,符号写错了
    用下面的
    <script language=javascript>
          newwin   =   window.open( "1.htm", "", "这里写参数"); 
          newwin.close()
          window.opener=null
          window.open("","_self")
          window.close(); 
    </script>
      

  5.   

    ddddddd