fox与ie的iframe 的document事件
2008-09-19 11:36
656 查看
<div style="width: 100px; height: 100px">main
</div>
<div style="width: 528px; height: 292px">iframe
<iframe src="iframe.htm"></iframe>
</div>
<script>
document.onkeydown = function(){alert(100)};
var iframes = document.getElementsByTagName("iframe");
if ( isIE )
iframes[0].contentWindow.document.onkeydown = function(){alert(200)};
if ( isFox )
iframes[0].contentWindow.onkeydown = function(){alert(200)};
</script>
</div>
<div style="width: 528px; height: 292px">iframe
<iframe src="iframe.htm"></iframe>
</div>
<script>
document.onkeydown = function(){alert(100)};
var iframes = document.getElementsByTagName("iframe");
if ( isIE )
iframes[0].contentWindow.document.onkeydown = function(){alert(200)};
if ( isFox )
iframes[0].contentWindow.onkeydown = function(){alert(200)};
</script>
相关文章推荐
- BT9034: 仅 IE 和 Opera 支持 HTMLFrameElement 和 HTMLIFrameElement 的 document 属性
- window.frames[iframe].document 在ie可以用,在360、火狐中都不兼容?
- VB的WebBrowser防止多iframe执行多次DocumentComplete事件
- fox与ie事件管理:fox是队列,ie是堆栈
- IE下因设置document.domain而无法和Iframe通信的解决方法
- 给ie的iframe注册onload事件
- IE中设置了document.domain后操作iframe的问题
- iframe 自适应高度 ,绝对好用。兼容IE和FOX
- IE下的iframe的onload事件
- IE中iframe和document.selection.createRange导致跨域
- IE下被遮住的iframe能接收事件
- IE下因设置document.domain而无法和Iframe通信的解决方法(SCRIPT5: 拒绝访问)[转] 最近在开发SDK的过程中发现IE下有个很怪异的问题:在同一域下,因
- html,获取iframe的window,document,自定事件与iframe通信
- 在IE的document上触发事件问题
- IE中document.createElement的iframe无法设置属性name问题
- 自定义document.getElementsByName() 兼容IE Firfox
- IE9/IE10使用隐藏iframe异步上传文件问题的解决方案
- IE7下IFRAME高度问题
- ie 跨域,别的网站用iframe嵌进去后无法读取session
- window/body/img/iframe 的onload事件