简单方便的iframe刷新方式

在网页中我们经常会使用和看到刷新,那么你知道HTML中的iframe刷新方式有哪些吗?那么今天就按照小编一起去了解简单方便的iframe刷新方式。

<iframe src=”1.htm” name=”ifrmname” id=”ifrmid”></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=”ifrmid.window.location.reload()”>

三、

  当iframe的src为其它网站地址(跨域操作时)
<input type=”button” name=”Button” value=”Button” onclick=”window.open(document.all.ifrmname.src,’ifrmname’,”)”>

以上就是小编为大家介绍简单方便的iframe刷新方式,只要你了解了它们,发动我们的思维和想象,就可以熟练的运用它们、展现它们独特魅力的一面。