javascript 獲取父頁面中元素對象方法


 

父頁面中

<input type="hidden" id="areaID" value="test1">  

<iframe align="center" style="width: 100%; height: 100%;" frameborder="0" scrolling="no" src="Html//test.jsp"></iframe> 

<iframe id="ifra2" align="center" style="width: 100%; height: 100%;" frameborder="0" scrolling="no" src="Html/test2.jsp"></iframe>

 

test.jsp中獲取父頁面中元素的方法

parent.document.getElementById("areaID").value=row.ID;

test.jsp中獲取父頁面中iframe元素的方法
var child = parent.document.getElementById("ifra2").contentWindow;//ifra2這個id是父頁面iframe的id
child.initRealTimeGrid("bb");//調用ifra2中頁面中的方法;
 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM