<iframe id="ifr" src="test.html"></iframe>
ifr.location.reload();

解决方案 »

  1.   

    不能用document.getElementById("ifr").reload();
    要用ifr.location.reload();
      

  2.   

    贴多点代码,frame中的页面是存在location对象的
      

  3.   

    有location对象,看你是怎么引用的,不过跨站控制可能会没有权限:
    <input type="button" value="Reload" onclick="document.frames.frm1.location.reload(true);">
    <iframe src="page.htm" name="frm1"></iframe>
      

  4.   

    写错了,是不能用document.getElementById("ifr").location.reload();
      

  5.   

    function update(p)
    {
    document.f.pg.value=p;
    document.writeln(document.f.pg.value);
    ifrm.location.reload();}function PrePage()
    {
    if (document.f.pg.value>1)
    {
    p=document.f.pg.value;
    --p;
    document.f.pg.value=p;
    update(p);
    }
    }function NextPage()
    {
    size=document.f.size.value;
    len=document.f.len.value;
    pgnum=(len+size-1)/size; if (document.f.pg.value<pgnum)
    {
    p=document.f.pg.value;
    ++p;
    document.f.pg.value=p;
    update(p);
    }

    }....
    <input type=hidden name="len" value=10>
    <input name=pre type=button value="pre" onclick="javascript:PrePage();">
    &nbsp;&nbsp;
    <input name=pre type=button value="Next" onclick="javascript:NextPage();">
    </td>
    <tr>
    <td>
    <iframe id="ifrm" name="ifrm" frameBorder="0" src=show.html></iframe>
    </td>
    代码如上,继续求教
      

  6.   

    楼主代码的简化版,并没有发现错误。报错,可能是别的地方的原因也就是说 → ifrm.location.reload();  这句话没错以下为简化版,请楼主测试...
    <script language="javascript">
    <!--
    function update()
    {
        ifrm.location.reload();}function PrePage()
    {
            update();
    }function NextPage()
    {
            update();
        
    }//-->
    </script><input type=hidden name="len" value=10>
    <input name=pre type=button value="pre" onclick="javascript:PrePage();">
    &nbsp;&nbsp;
    <input name=pre type=button value="Next" onclick="javascript:NextPage();">
    </td>
    <tr>
    <td>
    <iframe id="ifrm" name="ifrm" frameBorder="0" src=show.html></iframe>
    </td>
      

  7.   

    当html文件解释完毕,文件输出流也就结束了,此时再有页面数据输出(例如document.write),那么原来的页面就会被清空,然后输出数据,此时ifrm由于页面已被清空,当然不复存在了