码迷,mamicode.com
首页 > Windows程序 > 详细

各浏览器Iframe对contentWindow、contentDocument、document及frames属性测试

时间:2014-07-16 21:07:05      阅读:240      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   java   width   2014   

 

Iframe易于嵌套及管理页面,但经常遇到跨域、父子页面访问问题,对于子页面访问父页面可以兼容性地通过window.Top或window.Parent或window.frameElement等操作,但对于标题中四个对象,一直没有完整测试过,故买个苦力,分享给大家。

bubuko.com,布布扣

结论:
1. 就浏览器而言(横向),IE8/IE9/360安全浏览器全部支持;
2. 就属性而言(纵向),contentWindow和frames所有浏览器都支持,其次是contentDocument,document支持性最差;
3. 由于iframe经常涉及跨域,本地测试(即未发布)环境中,chrome/360极速/IE6/IE9对于contentWindow.document属性是deny状态,原因是Unsafe JavaScript attempt to access frame with URL file:///***.html from frame with URL file:///***.html Domains, protocols and ports must match。IE9本地环境下对于contentDocument也是deny的。

各浏览器Iframe对contentWindow、contentDocument、document及frames属性测试,布布扣,bubuko.com

各浏览器Iframe对contentWindow、contentDocument、document及frames属性测试

标签:style   blog   http   java   width   2014   

原文地址:http://www.cnblogs.com/aaronjs/p/3836122.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!