请教高手:iframe有没有location对象?本人在js里设置location.reload(true)时,client老实报object is null or is not object <iframe id="ifr" src="test.html"></iframe>ifr.location.reload(); 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 不能用document.getElementById("ifr").reload();要用ifr.location.reload(); 贴多点代码,frame中的页面是存在location对象的 有location对象,看你是怎么引用的,不过跨站控制可能会没有权限:<input type="button" value="Reload" onclick="document.frames.frm1.location.reload(true);"><iframe src="page.htm" name="frm1"></iframe> 写错了,是不能用document.getElementById("ifr").location.reload(); 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();"> <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>代码如上,继续求教 楼主代码的简化版,并没有发现错误。报错,可能是别的地方的原因也就是说 → 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();"> <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> 当html文件解释完毕,文件输出流也就结束了,此时再有页面数据输出(例如document.write),那么原来的页面就会被清空,然后输出数据,此时ifrm由于页面已被清空,当然不复存在了 仿关机效果<遮屏> 高问题 请进 CSDN变灰了? 先求一个思路吧 用js实现:求给定年月的月天数。万分火急...不吃中饭在线等 紧急呼救:求弹出式窗口代码 关于网页中加入视频 求一广告js代码?(象sohu,在网页的两侧,滚动条移动时,广告跟随移动) 怎样让 Html 变成文本编辑框? 菜鸟求教 怎样正确全面的捕捉到用户按键内容? 麻烦给看一下,这几行javascript脚本怎么了?为什么在浏览器中显示不出来数组的值?
要用ifr.location.reload();
<input type="button" value="Reload" onclick="document.frames.frm1.location.reload(true);">
<iframe src="page.htm" name="frm1"></iframe>
{
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();">
<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>
代码如上,继续求教
<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();">
<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>