百合心
lily64 · 2008-01-25
<< 陈礼荣:“联圣”妙作幸有传
|
首 页
|
梅雪香:DOM2中的高级事件处理 >>
2008-01-25
js访问iframe(兼容ie&ff)
- [
技术空间
]
版权声明
:转载时请以超链接形式标明文章原始出处和作者信息及
本声明
http://lily64.blogbus.com/logs/14613015.html
对比了一下ie和ff下对iframe的一些访问的异同点。
<iframe id=ifrm name=ifrm2 src=ifrm.htm></iframe>
<input type=button value=ie onclick=alert(document.frames[0].document.documentElement.innerText)>
<input type=button value=ie2 onclick=alert(window.frames[0].document.documentElement.innerText)>
<input type=button value=ie3 onclick=alert(document.getElementById("ifrm").contentWindow.document.documentElement.innerText)>
<input type=button value=ff onclick=alert(document.getElementById("ifrm").contentDocument.documentElement.textContent)>
<input type=button value=ff2 onclick=alert(document.getElementById("ifrm").contentWindow.document.documentElement.textContent)>
<input type=button value=ff3 onclick=alert(window.frames[0].document.documentElement.textContent)>
<input type=button value=get onclick=alert(document.getElementById("ifrm").contentWindow.document.getElementById('txt').value)>
<input type=button value=get2 onclick=alert(window.frames[0].document.getElementById('txt').value)>
<input type=button value=get3 onclick=alert(window.frames['ifrm2'].document.getElementById('txt').value)>
<input type=button value=src onclick=alert(document.getElementById('ifrm').src)>
<input type=button value=src2 onclick=alert(window.frames[0].location.href)>
随机文章:
跨双iframe进行拖拽伸缩(兼容ie&ff)
2008-01-27
iframe模拟frame拖动(兼容ie&ff)
2008-01-15
文本文件选取、处理和比较的js代码(兼容ie&ff )
2008-01-28
无限级树型菜单(非递归)(修订版)(兼容ie&ff)
2007-09-11
php版带翻页的购物车代码(兼容ie&ff)
2007-08-16
收藏到:
Del.icio.us
Tag:
技术空间
js
兼容ie&ff
iframe
代码
引用地址:
lily64
发表于
13:38:55
|
编辑
|
继续话题
|
转发
|
推荐
发表评论
原始快照:web.archive.org