IE下iframe不能正常加载,显示空白
来源:互联网 发布:ubuntu主题美化 编辑:程序博客网 时间:2024/05/01 19:36
下午帮忙看了一个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运行在客户端。
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.
此代码是用来控制哪些用户访问时不会提示验证提示框,而我们如何跳过这个设置,来运行我们的web项目呢?
我们可以远程预览页面或者在本地部署iis/tomcat服务器来运行项目,这样就可以在IE下正常加载<iframe>页面,并且不影响安全性验证提醒。
参考:
IE中iframe local 无法显示的解决方法
- 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下中国银行网站不能正常显示
- MFC(继续画图,孙鑫C++第十讲笔记整理)
- getevent/sendevent源代码
- 使用MinGW 编译python扩展模块
- paip.SVN merge分支合并到主干
- 第05章 数组 05 练习3
- IE下iframe不能正常加载,显示空白
- Windows7 旗舰版 32 位安装oracle10g的方法
- 状态模式---设计任务系统
- 防火墙如何实现保护功能
- 1004
- ACM成长之路
- GB2312,GBK,GB18030,UTF-8
- Android 扫描SDCard上的音乐文件以及监听扫描事件
- 解决matlab2012安装时快捷方式和.m文件自动关联的问题(太有用了)