一个主网页里有iframe,点击主网页上的treeview的节点,可以调用网页a,b..等到iframe中显示.网页a,b...上都有关闭的按钮,我的问题是点击关闭按钮只关闭本身的网页,不是关闭整个窗口,如点a网页上的按钮,只关闭a网页,如点b网页上的按钮,只关闭b网页...

解决方案 »

  1.   

    top.loction.href="close.aspx";
    close.aspx里面,windon.close();
      

  2.   

    <input name=btn_close onclick="javascript:parent.parent.window.close()" type="button">
      

  3.   

    <input type=button onclick="parent.window.close()">
      

  4.   

    哦,我理解错误了,点击关闭,整个iframe框架网页都关掉了。是伐?楼主。
      

  5.   

    <input type=button onclick="parent.window.close()">
      

  6.   

    不能单关闭子页面,close是关闭窗口的,你可以使子页面定位在about:blank,用那个框架的href属性赋值.
      

  7.   

    节点上top.location.href="a.aspx"; a.aspx上的关闭
    <input type=button value="close" onclick="parent.top.location.href="">
      

  8.   


    <html>
    <frameset cols="50%,*"> 
    <frame name="left" src="b.html"> 
    <frame name="right" src="a.html" > 
    </frameset> 
    </html><html>
    <head></head>
    <body>aaaaaaaa
    <input type=button value="close" onclick="parent.right.location.href='about:blank'">
    </body>
    </html><html>
    <head></head>
    <body>bbbb
    <input type=button value="close" onclick="parent.right.location.href='a.html'">
    </body>
    </html>
      

  9.   

    我的意思是在iframe显示a网页后,a网页调用了b网页,点b网页上的按钮关闭b网页,iframe上还是显示a网页.我现在是在b网页的butoon上用history.back()来处理的,是否有更好的方法.
      

  10.   

    你可以做一个空白页面  点击关闭时让它跳转到空白页面
    或者 将iframe的src清空
      

  11.   


    一种是用history.back()从b回到a
    另一种就是将iframe的href.location重新定位回a网页.我上面已经写了代码了
      

  12.   

    用style的display属性就可以解决啊