获取iframe里面的HTML代码
给iframe动态赋值src后获取iframe里面的html代码要点2次按钮为什么?用什么方法可以点一次按钮就解决呢?
<iframe id="iRequest" frameborder="0" scrolling="no" width="480" height="250"></iframe>
<input type="button" value="111111" onclick="WebEditor1()" />
第一次点button iframe能加载页面带式textbox里面没内容,再点button textbox里面才现在html代码!
<script type="text/javascript">
function WebEditor1() {
document.getElementById("iRequest").src = "72247804.mht";
document.getElementById("TextBox2").value = document.frames("iRequest").document.body.innerHTML;
}
</script>
<iframe id="iRequest" frameborder="0" scrolling="no" width="480" height="250"></iframe>
<input type="button" value="111111" onclick="WebEditor1()" />
第一次点button iframe能加载页面带式textbox里面没内容,再点button textbox里面才现在html代码!
...全文
相关推荐
Jquery方式获取iframe页面中的 Dom元素
主要介绍了Jquery方式如何获取iframe页面中的Dom元素,需要的朋友可以参考下
嵌入到HTML的iframe自动适应大小
让嵌入到HTML的iframe自动适应大小
js获取iframe中的内容
js获取iframe中的内容
原生js获取iframe中dom元素--父子页面相互获取对方dom元素的方法
下面小编就为大家带来一篇原生js获取iframe中dom元素--父子页面相互获取对方dom元素的方法。小编觉得挺不错的,现在就分享给大家,也给大家做个参考。一起跟随小编过来看看吧
js获取IFRAME当前的URL的方法
在用iframe的时候都会做分页操作 iframe内部的url跳转将不能直接通过iframe的src属性来获得,下面与大家分享下iframe的当前url的获取方法


