IE6中提示Internet Explorer cannot open the Internet site
来源:互联网 发布:全途打单软件怎么样 编辑:程序博客网 时间:2024/05/24 05:28
最近修改集智V5浏览器兼容性问题时,遇到点击按钮之后的无法显示弹出层,而是弹出“Internet Explorer cannot open the Internet site”问题。上网查了解决办法,但是都没有解决问题。最后查找发现将“jquery.js”替换成“jquery-dbd.js”解决了问题。
通过从网上学习,总结一部分解决方法。为以后修改此类问题或开发提供一些注意事项,避免再次出现类似情况。
1.页面没有加载完成就调用了一个脚本程序.直接触发了jQuery的事件。
在修改兼容性问题时,发现一些页面上都在一个页面中使用多个$(function(){});这种方式很有可能导致页面没有加载完全就去操作页面中的代码。导致错误。最好将页面加载完成之后的操作放到
$(document).ready(function(){
//要执行的操作
});
2.在页面还没有完全加载的情况下,鼠标点击触发了一个生成iFrame的脚本事件。
正常的页面结构是
<body>
<form>
........
</form>
</body>
生成iframe的脚本是:
function CreateiFrame(){
var objBody = document.getElementsByTagName("body").item(0);
var objiFrame = document.createElement("iframe");
objBody.appendChild(objiFrame);
}
appendChild() 方法,在节点的子节点列表末添加新的子节点。所以创建iframe后的DOM为:
<body>
<form>
........
</form>
<iframe>
........
</iframe>
</body>
因为是在<form>还没有加载完全的情况下,创建了<iframe>,所以在IE6下就出现了页面错误
那么,我们就需要用到另外一个添加元素的方法 insertBefore():
function CreateiFrame(){
var objBody = document.getElementsByTagName("body").item(0);
var objiFrame = document.createElement("iframe");
objBody.insertBefore(objiFrame,document.getElementById("form1")); //form1为form的id
}
insertBefore() 方法,在节点的子节点列表任意位置插入新的节点。
insertBefore有2个参数可以设置,第一个是和appendChild相同的;第二可以为null,效果等同于insertBefore() 方法,也可以为指定需要在哪个子节点之前插入新子节点。
<body>
<iframe>
........
</iframe>
<form id“form1”>
........
</form>
</body>
总结:在开发过程中代码要尽量按照规范来写,不要使用多个$(function)并且尽量将js,css通过外部引入的方式实现,不要全放在jsp页面中,操作页面代码,要等页面完全加载成功之后操作。
- IE6中提示Internet Explorer cannot open the Internet site
- IE6 Internet Explorer cannot open the Internet site http .
- Internet Explorer cannot open the Internet site - Operation aborted
- Internet Explorer cannot open the Internet site http://.com. Operation aborted.
- Internet Explorer Cannot Open the Internet Site Operation Aborted, how to fix this error?
- (ietest)ie 6 出现 Internet Explorer cannot open the Internet site可能原因
- showModalDialog 中 在IE6 cann't open the Internet site 已终止操作 .如何操作
- 使用<base target="_self" /> IE6 cann't open the Internet site 已终止操作
- 使用<base target="_self" /> IE6 cann't open the Internet site 已终止操作
- Exploring the Internet Explorer WebControls...
- OLE with the internet explorer
- Internet Explorer
- Internet Explorer
- Writing to the Internet Explorer Cache
- 无法显示登录网页(Internet Explorer cannot display the webpage)--原因及解决办法
- 关于Internet Explorer 6(IE6)不支持CSS中!important属性
- cannot open HTML Help files from Internet
- Automate the Active Windows Explorer or Internet Explorer Window
- 写给3年后的XXX【连载】--1.3 步入而立之年的程序员的迷茫
- 获取某个对象的元数据
- 第四次c语言上机实验报告
- Spring mvc+hibernate工程搭建
- Android AIDL的重新理解
- IE6中提示Internet Explorer cannot open the Internet site
- 静态方法快、非静态方法快、构造函数的执行顺序
- 第五堂课后作业
- Linux TCP/IP 协议栈的关键数据结构Socket Buffer(sk_buff )
- 【C语言】makefile的使用
- sprintf的用法
- mysql锁表机制分析
- jsp和Servlet各自特点
- 第六堂课后作业