top.frames.actionFrame.x.close();
window.close();
<iframe name="actionFrame"....

解决方案 »

  1.   

    好像不对哦,top是哪里来的呀以前我用的是document.actionFrame.x.close()也不对
      

  2.   

    <input type='button' onclick='window.close();parent.I2Frame.x.close();'>
      

  3.   

    main.htm
    -----------------------------------------------------------------
    <html>
    <head>
    <title>W1</title>
    </head>
    <body bgcolor="#EFEFEF">
    <table width="100%" border="0" cellpadding="0" cellspacing="1" >
     <tr align="center" valign="middle"> 
       <td  height="25"><div align="left">名称<br></div></td>
       <td height="30" colspan="2" ><div align="left">
       <IFRAME src="main1.htm" name=I2Frame
    width="100%" height=30 align=default frameBorder=0 >This message is only visible to older browsers. Replace this with meaningful content!</IFRAME></div></td>
     </tr>
    <tr><td><input type='button' onclick='window.close();parent.I2Frame.x.close();'></td></tr>
    </table>
    </body>
    </html>main1.htm
    ------------------------------------------------------------------------
    <script>
    var x=null;
    function open_onclick(){  //此函数用作打开窗口W3
    if(x==null)
    x=window.open("W3.html","W3window","width=600,height=500");
    else 
    x.focus();
    }
    open_onclick();
    </script>
    ----------------------------------------------------------------------
    我这边是可以关掉的
      

  4.   

    如果先关掉窗口W3怎么通知父窗口W3已经关掉了呢?若不通知的话再次点击W2中的打开按钮想打开W3就打开不了了....
      

  5.   

    利用window.opener可以访问父窗口
      

  6.   

    你的按纽不能连续打开窗口是吧!
    在你的W3.HTML的<body>中加入使成为
    <body onUnload='parent.x=null;'>
      

  7.   

    你的按纽不能连续打开窗口是吧!
    在你的W3.HTML的<body>中加入使成为
    <body onUnload='opener.x=null;'>