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