近期所做的一个系统在使用的过程中,有用户在登录后导向首页的时候,ie浏览器报出“Internet Explorer无法打开xxx,已中止操作”的错误,在确定之后,页面显示”此程序无法显示网页“。奇怪的是,同样的页面,同一类型的用户,目前只发现一名用户出现了这种问题,感到非常茫然。
在查找资料之后,发现此错是由于IE浏览器的bug引起,该bug的产生情景是:子容器中的脚本区企图对父容器进行改变。这个改变包括:改变父容器的innerHTML;改变父容器的child。如以下两例所示:
<html>
<body>
<div>
<script type="text/Javascript">
document.body.innerHTML+="sample text";
</script>
</div>
</body>
</html>
<html>
<body>
<table>
<tr>
<td>
<script type="text/Javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</td>
</tr>
</table>
</body>
</html>
解决这个问题的方法是:
1、将脚本直接放置在父容器之中。
2、脚本运行前,所操作的父容器元素已被关闭。
例1的解决方案:
<html>
<body>
<div>
</div>
<script type="text/Javascript">
document.body.innerHTML+="sample text";
</script>
</body>
</html>
<html>
<body>
<div id="targetContainer">
</div>
<div>
<script type="text/Javascript">
document.getElementById('targetContainer').innerHTML+="sample text";
</script>
</div>
</body>
</html>
例2的解决方案:
<html>
<body>
<table>
<tr>
<td>
</td>
</tr>
</table>
<script type="text/Javascript">
var d = document.createElement('div');
document.body.appendChild(d);
</script>
</body>
</html>
例子参考于微软网站:http://support.microsoft.com/kb/927917/en-us/#top
分享到:
相关推荐
此文档经尝试已解决无法打开Internet的问题:有些时候打开某些网站会出现Internet Explorer无法打开Internet站点http://XXXXXXXXX已终止操作
Internet Explorer无法打开Internet站点.docx
windows、 Internet Explorer 系统常见问题
Internet Explorer已停止工作 win 7 win8
去掉IE提示:internet explorer 已限制此网页运行脚本或Activex控件
利用模拟操作,自动删除Internet Explorer缓存
当您为 Windows 7 安装 Internet Explorer 11 时,安装程序会尝试自动安装某些系统必备组件...如果任何更新安装过程中或者重新启动系统处于挂起状态,为 Windows 7 的 Internet Explorer 11 无法自动安装系统必备组件。
恢复桌面Internet Explorer图标
提供如何進行Internet Explorer 8的卸载。
有时某些软件会破坏系统中的IE浏览器dll文件,导致诸如不能打开弹出窗口之类的问题,这时就需要重新注册相关dll才可以使IE正常工作。那么,需要重新注册哪些dll文件呢?
Internet Explorer 5.5正式版安装程序,适合Windows 98、2000的升级
Advanced IE (Internet Explorer) Password Recovery is a program to Recover passwords to web sites saved in Microsoft Internet Explorer (in local password list), as well as AutoComplete strings (form ...
Internet Explorer 9.zip
可以浏览Internet Explorer的缓存文件
一个列表 罗列Internet Explorer 1.0 到7.0所有小版本号
Microsoft Internet Explorer 4.01 (4.71.1712) [Simpl. Chinese].7z
微软发布了Internet Explorer Developer Toolbar最新版.该产品让开发人员能够深入探索和理解Web页面,帮助开发者更好地创建Web应用.安装后可以在IE中快速分析网页的软件.该工具条可集成在IE窗口,或以浮动窗口形式存在
CNC远程操作工具NC_Explorer(无需序列号)
Internet Explorer 3 03 3 03 2925
Internet Explorer 3.01 for Windows3.11 收藏品和网站开发者调试用