1. 程式人生 > >彈出視窗中重新整理父頁面中的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','')">