局部刷新iframe中的页面,常用的几种方法
例:
<iframe src="a.html" name="ifrmname" id="id"></iframe>
方案一:用iframe的name属性定位
<input type="button" name="Button" value="Button" onclick="document.frames('ifrmname').location.reload()">
或
<input type="button" name="Button" value="Button" onclick="document.all.ifrmname.document.location.reload()">
方案二:用iframe的id属性定位
<input type="button" name="Button" value="Button" onclick="id.window.location.reload()">
方案三:当iframe的src为其它网站地址(跨域操作时)
<input type="button" name="Button" value="Button" onclick="window.open(document.all.ifrmname.src,'ifrmname','')">
方案四:通过和替换iframe的src来实现局部刷新
可以用document.getElementById(“id”).src=""来进行iframe得重定向;