设定需要刷新的iframe的name属性为yourIframe1
在提交后的返回页面中写入如下语句:
<script language="JavaScript">
function rf()
{
alert("函数相应: Loading...稍等,上面的iframe,就是我的主页了。")
parent.iframe1.location="http://www.redv.com"
}
rf()//加在函数也可以在body里用onload=rf()加载,
</script>例子:
http://dsa.cumt.edu.cn/new/student/article/temp/iframe.htm

解决方案 »

  1.   

    我可能还没说清楚,我不想刷新主页面。在iframe1中提交更新的数据,并写到文件中去。然后再iframe2中能刷新出来我刚才更新的数据。整个过程,主页面没有刷新。
      

  2.   

    对呀,我的整个过程就是没有刷新主页面(在例子中是iframe.htm),而只是提交了iframe2.asp,通过提交返回的页面新的iframe2.asp来刷新iframe1(注意我上面写的是parent.iframe1---这里是iframe1页面,不是ifram.htm页面。)源码贴在下面一帖。
      

  3.   

    这是主页面:iframe.htm
    <html>
    <head>
    <title>无标题文档</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head><body bgcolor="#FFFFFF" text="#000000">
    <iframe name="iframe1" src="http://dsa.cumt.edu.cn/new/student/article/" width="750" height="200"></iframe><iframe name="iframe2" src="iframe2.asp" width="750" height="200"></iframe>
    </body>
    </html>''''''''''''''''''''''
    这是iframe2.asp
    <html>
    <head>
    <title>无标题文档</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <%
    if Request.Form("go")<>"" then//注意这里的判断
    %>
    <script language="JavaScript">
    function rf()
    {
    alert("函数相应: Loading...稍等,上面的iframe,就是我的主页了。")
    parent.iframe1.location="http://www.redv.com"//注意这里!!!
    }
    rf()
    </script>
    aaaaaaaaaaaaaaaaaa
    <%
    end if
    %><form action="iframe2.asp" method="post">
    <input type="hidden" name="go" value="1">
    <input type="submit" name="submit1" value="Submit">
    </form>
    </body>
    </html>
    ''''''''''''''''''
    iframe1.htm没有什么,就是显示数据吗?这个应该会的。