如何刷新iframe子页面呢?
例如:A.html里有iframe name="frm" src="B.html",如果我在A页面里点击一个按钮让B页面刷新该怎么做呢?

解决方案 »

  1.   

    试试 window.frames['frameName'].reload();
      

  2.   

    我测试的代码如下:请帮忙检查下
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script language="JavaScript"> 
    function open_window() {
    window.frames['test1'].reload();

    </script> 
    </head>
    <body>
    <button id="we" name="we" onclick="open_window()">dianji</button>
    <iframe src="http://www.baidu.com" id="test1" width="400" height="400" name="test1"></iframe>
    </body>
    </html>
      

  3.   


    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <title>无标题文档</title>
    <script language="JavaScript"> 
    function open_window() {
    window.frames['test1'].location = "http://www.baidu.com";

    </script> 
    </head>
    <body>
    <button id="we" name="we" onclick="open_window()">dianji</button>
    <iframe src="http://www.csdn.net" id="test1" width="400" height="400" name="test1"></iframe>
    </body>
    </html>