if (window.opener<>null || !window.opener.closed)
{
    window.opener.opener=null;
    window.opener.close();
}

解决方案 »

  1.   

    http://expert.csdn.net/Expert/topic/2350/2350292.xml?temp=.3081171
      

  2.   

    if (!self.opener.closed){
    self.opener.close();} 
      

  3.   

    if (window.opener!=null || !window.opener.closed)
    {
        window.opener.opener=null;
        window.opener.close();
    }更正^^
      

  4.   

    这个是default.html的打开代码 
     window.open ("//localhost/EForum/login.aspx", "newwindow", "height=150, width=350, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=yes,left=250,top=250")
      

  5.   

    TXZY(木下藤吉郎) (谢谢。
    你的方法行啦。
    是我自己的问题
    window.opener.opener=null;
    为什么有两个opener啊。
      

  6.   

    你现在要关闭default.html吗?不要判断,直接执行下面两句,有什么错误提示吗?
    注意这两句话,必须是在login.aspx里面的.不能放在default.html里面.
    window.opener.opener=null;
    window.opener.close();如果要在default.html里面执行需要改一改.
    window.opener=null;
    window.close();
      

  7.   

    呵呵login.aspx的窗口window.opener是default.html如果要关闭default.html,而没有提示,需要清除default.html的window.opener
    所以对login.aspx中执行的时候就需要
    window.opener.opener=null需要理解哈.^^