我有一个页面a,有个按钮b和一个iframe ifr,点b弹出一个页面c.点c上的按钮之后关闭c,同时要刷新ifr.该怎么做?谁写个代码,谢谢!!

解决方案 »

  1.   

    a.htm
    <iframe src='b.htm' name='ifr'></iframe>
    <br/>
    <input type="button" onclick="window.open('c.htm')" value="打开c"/>b.htm
    <script>
    document.write(new Date().toString());
    </script>c.htm
    <input type="button" onclick="RefreshIfr()" value="关闭并刷新Ifr"/>
    <script>
    function RefreshIfr()
    {
      opener.document.frames["ifr"].document.location.reload();
      self.close();
    }
    </script>
      

  2.   

    利用模式窗口。它可以提供一个返回值,具体google。 查找 showModalDiag