//这一篇是Javascript,不是Jquery
1,实现javascript重载iframe页面,兼容各浏览器的方法
document.getElementById(FrameID).contentWindow.location.reload(true);
2,其次是获取iframe内的元素并应用
iframe.contentWindow.document.getElementById(id).style.display="block";
3,iframe页面调用父级页面中的函数
parent.dofunction();
关键字:contentWindow与parent
contentWindow 实例
iframe = document.getElementById("frame");
iframe.contentWindow.location = "http://mozilla.org";
iframe.contentWindow.history.back();
说明 http://www-archive.mozilla.org/docs/dom/domref/dom_frame_ref5.html
先整理这些,备录,继续完善。转自:http://www.liuhui.info/article16.html
获取 Iframe内的元素对象
test1.html //转自:http://fkshl.iteye.com/blog/715632
<html>
<head>
<script>
function t(){
var dd = document.all('test2').contentWindow.document;
dd.getElementById('my').style.display='none';
}
function getImage(paht)
{
var dd = document.all('test2').contentWindow.document;
dd.getElementById('covertImage').src=paht;
}
</script>
</head>
<body >
<input type="button" value="test" onClick="t();"/>
<input type="button" value="image1" onClick="getImage('1.jpg')"/>
<input type="button" value="image2" onClick="getImage('2.jpg')"/>
<input type="button" value="image3" onClick="getImage('3.jpg')"/>
<input type="button" value="image4" onClick="getImage('4.jpg')"/>
<iframe id="test2" name="test2" src="test2.html" frameborder="0" ></iframe>
</body>
</html>
test2.html
<html>
<head>
</head>
<body>
<div id="my" name="my">
测试一下,父窗体可以把我隐藏掉!!!!!!!!
</div>
<img src="" id="covertImage"/>
</body>
</html>