IE下iframe不能正常加载,显示空白
来源:互联网 发布:5g 知乎 编辑:程序博客网 时间:2024/05/01 20:49
下午帮忙看了一个web问题,index.html中嵌入<iframe>来加载同文件目录下的一个页面,在多个浏览器下测试,发现IE浏览器中会出现问题,<iframe>不能正常加载,显示空白页,右键属性为"_blank"。
一开始,想到的是src属性的问题,可能是路径不对,但是经过不同浏览器测试,不存在路径问题。
单独把src路径拿出来,贴到IE浏览器中,发现页面加载没问题。通过分析,问题应该出现在index.html文件中,单独的<iframe>加载ok,通过排除法,就是Index.html文件中某些代码出现了问题,使得IE浏览器发飙了。
然后,上网找寻答案,有很多很多的帖子在问相关问题,也有很多人开博写这种问题的解决办法,大概罗列如下:
1.IE浏览器的bug,<iframe>标签的src属性不要放到第一位,因为这样会诱发IE的bug.
2.采用动态创建dom节点的方式,来创建<iframe>动态加载页面。
后来经过大勇的测试发现,将index.html页面头部的<!--saved from url=(0022)http://www.yoururl.com -->代码去掉之后,页面加载问题解决了,但是这行代码的作用何在?
这也是解决了本问题的一个方案,经过查阅资料,这行代码的用途是IE下安全验证的一个设置,来控制是否会弹出黄色的消息提示框,来提醒你是否允许此Active运行在客户端。
- <span style="font-size:18px;">To allow active content or scripting to run in a web page without the
- Information Bar appearing, you can add "Mark of the Web" code,
- so that the file is run in a zone other than the Local Machine zone,
- for example the Internet zone or the Intranet zone.
- The following code is an example of a Mark of the Web:
- <!-- saved from url=(0022)http://www.yoururl.com -->
- To include the code above in your projects, change the URL
- to point to your domain, and change the number (0022) to the
- correct number for your domain. This number indicates
- how many characters are in your domain name (beginning with
- the "h" in "http", and ending with the last letter of your domain;
- for example, the "m" in ".com").
- A generic way of writing the Mark of the Web code is as follows:
- <!-- saved from url=(0014)about:internet -->
- about:internet will place the page in the Internet zone,
- allowing the page to bypass the Local Machine zone lockdown. </span>
此代码是用来控制哪些用户访问时不会提示验证提示框,而我们如何跳过这个设置,来运行我们的web项目呢?
我们可以远程预览页面或者在本地部署iis/tomcat服务器来运行项目,这样就可以在IE下正常加载<iframe>页面,并且不影响安全性验证提醒。
- IE下iframe不能正常加载,显示空白
- IE下iframe不能正常加载,显示空白
- IE 6 iframe页面加载空白
- 中文图片路径IE下不能正常显示解决方案
- utf-8编码页面在IE6下不能正常显示 打开时出现空白面页
- UIWebView加载htmlString信息,在iOS6下正常显示iOS7.1空白
- Xcode6,iOS8,百度地图不能正常显示,显示空白
- 在 IE 7 菜单不能正常显示
- ie不能正常显示图片问题
- IE浏览器下CSS不能在UTF-8页面正常显示的问题
- html 图片在IE下不能显示,但谷歌 火狐正常
- jpg图片在firefox正常显示 在ie不能显示
- jpg图片在firefox正常显示 在ie不能显示
- jpg图片在firefox正常显示 在ie不能显示
- jpg图片在firefox正常显示 在ie不能显示
- div 隐藏在IE 6 7显示空白问题 ie 8 正常
- IE6 下 iframe 空白
- IE8下中国银行网站不能正常显示
- Page Cache, the Affair Between Memory and Files
- OpenStack官方文档研究笔记
- LTE演进路线图
- js获取日期:前天、昨天、今天、明天、后天
- 我的职业规划
- IE下iframe不能正常加载,显示空白
- Python 学习入门(32)—— xrange/range
- getResourceAsStream()
- 每天一个linux命令,包含最常用的几十个命令的详细使用,让您快速掌握Linux!
- java接口介绍
- Cocos2d-x 中C++调用java(jni)
- 卡尔曼滤波简单解释
- linux 编译命令备注
- 2013-12-12 17:10:48