iframe子页面内刷新父页面中另一个iframe子页面
生活随笔
收集整理的這篇文章主要介紹了
iframe子页面内刷新父页面中另一个iframe子页面
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
框架頁面如下:
<div id="aa" style="float: left; height: 500px; border-right-style: solid; border-right-color: #CCCCFF; border-right-width: 2px;"> <IFRAME id="tree" name="tree" src="/ScienProjectWeb/commonjsp/selectdepartment.jsp?classid=${Hthm_DefaultClassid}&user=1" frameBorder=0 width="248px" scrolling="auto" height="95%" allowtransparency> </IFRAME> </div> <div style="float: left;"> <div id="ttr" style="scrolling: auto;height: 300px;border:1px solid blue;"> <IFRAME id="opertop" name="opertop" src="/ScienProjectWeb/commonjsp/userlist.jsp" frameBorder="0" width="100%" scrolling="auto" height="100%" allowtransparency> </IFRAME> </div> <div style="height: 200px;border:1px solid blue;"> <IFRAME id="operbottom" name="operbottom" src="#" frameBorder="0" width="100%" scrolling="auto" allowtransparency> </IFRAME> </div> </div>
在tree頁面中想要刷新opertop頁面內(nèi)容,兩種方法:
第一種:window.parent.document.getElementById("opertop").src=url;(有無window.都可),注意,此處不能用window.parent.frames["opertop"].src=url;
第二種(推薦,將三個頁面互相傳遞信息的方法統(tǒng)一放在父頁面中,集中管理)
在父頁面中定義方法
function refreshframe(url) { //window.frames['opertop'].src=url;這種寫法也不對,只能通過document.getElementById方式 $('#opertop').attr("src",url); }子頁面中調(diào)用
parent.refreshframe(url);
?
?
轉(zhuǎn)載于:https://www.cnblogs.com/lengv10/p/3796985.html
總結(jié)
以上是生活随笔為你收集整理的iframe子页面内刷新父页面中另一个iframe子页面的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《收集苹果》 动态规划入门
- 下一篇: 代还信用卡30000手续费多少?手续费收