IE8"HTML Parsing Error:Unable to modify the parent container element before the child element is closed"错误
一、IE8报下面错误,解决办法:
网页错误详细信息
消息: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
行: 0
字符: 0
代码: 0
1、查看是否有未关闭的html标签,比如<table>而没有</table>
2、是否在页面未加载完前js代码操作了body里的元素,将相关js代码移到</body>后面
3、是否在代码中添加了addthis分享js
4、是否IE8打开了兼容性视图
(我的页面出错就是3、4两个原因导致的)
二、之所以发生这样的错误,是因为某些DOM操作发生在DOM树加载完成之前,比如appendChild
就像下面的代码:
<html>
<head>
</head>
<body>
<div>
<script type="text/javascript">
alert(document.readyState);
var oDiv = document.createElement("DIV");
oDiv.innerHTML = 'afish.cnblogs.com';
document.body.appendChild(oDiv);
</script>
</div>
</body>
</html>
当解析到DIV时就开始在BODY上appendChild,而这个时候BODY是还没有完全就绪的(It is not fully loaded),文档结构仍在loading和interactive状态之间,于是,便会得到上述错误。当然,该错误目前已确切知道的会存在于IE6和 IE7两个版本中(低于IE6的未进行测试),在IE8中将会得到一个HTML解析错误:HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
1.要解决这个问题,可以进行document.readyState状态判断,当它为complete时再进行相应的操作,或者给script标签加上defer属性(该属性在IE8中已不获支持)。
2.或者在js中加入了 setTimeout("xxx()",1000);,使其获得足够的加载时间后执行目标(xxx)的function,于是问题得到解决。
IE8"HTML Parsing Error:Unable to modify the parent container element before the child element is closed"错误的更多相关文章
- BUG笔记:Win XP IE8下HTML Parsing Error: Unable to modify the parent container element before the child
[Bug描述]Windows XP IE8的某些版本下页面只显示一部分,其余为空白.IE左下角有惊叹号报错标志,点开后显示字符如下: HTML Parsing Error: Unable to mod ...
- HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
IE8报错误: 用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; .N ...
- [Android] Android 使用Greendao gradle 出现 Error:Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava/lang/Object;)
Android 使用Greendao gradle 出现 Error:Unable to find method 'org.gradle.api.tasks.TaskInputs.file(Ljava ...
- 工作日志,error parsing query: unable to find time zone
工作日志,error parsing query: unable to find time zone 坑 Windows 系统使用influxdb数据库,在执行查询语句时提示 ERR: error p ...
- ERROR: Unable to globalize '/usr/local/NONE/etc/php-fpm.d/*.conf' 问题的解决
今天继续作大死,趟php7的配置的坑. 照例,安装了昨天的各种扩展之后,解压php7的压缩文件到 /usr/local/. 然后开始配置config的扩展: ./configure --prefix= ...
- git error: unable to rewind rpc post data - try increasing http.postBuffer
error: unable to rewind rpc post data - try increasing http.postBuffererror: RPC failed; curl 56 Rec ...
- Android Studio: Failed to sync Gradle project 'xxx' Error:Unable to start the daemon process: could not reserve enough space for object heap.
创建项目的时候报错: Failed to sync Gradle project 'xxx' Error:Unable to start the daemon process: could not r ...
- [nodejs] Error: unable to verify the first certificate
Error: unable to verify the first certificate Solution npm config set registry http://registry.npmjs ...
- Error: unable to connect to node rabbit@mail: nodedown
某天,开启一个应用时,发现连接rabbitmq失败,本来想用rabbitmqctl来查看队列,结果提示“Error: unable to connect to node rabbit@mail: no ...
随机推荐
- Asp.net Core深入一:数据库访问(Mysql为例)
一.数据库概述 1.一个DBContext操纵一个数据库 2.DbContext下的一个DbSet<Model类>关联一个表,但是也可以只写一个表,DbContext可以关联其他的表. 3 ...
- 2019-2020 ICPC, Asia Jakarta Regional Contest H. Twin Buildings
As you might already know, space has always been a problem in ICPC Jakarta. To cope with this, ICPC ...
- 自然语言处理NLP学习笔记一:概念与模型初探
前言 先来看一些demo,来一些直观的了解. 自然语言处理: 可以做中文分词,词性分析,文本摘要等,为后面的知识图谱做准备. http://xiaosi.trs.cn/demo/rs/demo 知识图 ...
- shell-常用命令,重定向和文件包含
shell的知识点并不多,这里简单介绍一下常用的一些东西 常用命令 echo 显示普通字符串 echo "test" 显示转义字符 echo "\"test\& ...
- 使用TensorFlow训练SSD(二):数据的准备
在进行模型的训练之前,需要准备好相关的数据,相关的数据还需要进行标注.这篇博客将使用labelImg标注工具来进行数据的处理. 首先可从https://github.com/tzutalin/labe ...
- [AcWing303/304]任务安排2/3
[AcWing303]任务安排2 有 \(N\) 个任务排成一个序列在一台机器上等待执行,它们的顺序不得改变.机器会把这 \(N\) 个任务分成若干批,每一批包含连续的若干个任务.从时刻 \(0\) ...
- 【转帖】.NET的一点历史故事:Novell的崩溃和Xamarin的重生
.NET的一点历史故事:Novell的崩溃和Xamarin的重生 https://blog.csdn.net/sD7O95O/article/details/78096502 学习安装 mono 时了 ...
- docker运行报错docker0: iptables: No chain/target/match by that name.
转自:https://blog.csdn.net/wohaqiyi/article/details/84450562 docker运行报错docker0: iptables: No chain/tar ...
- SQL SERVER 数据有CHAR(10),CHAR(13),CHAR(9)隐藏字符
原文:SQL SERVER 数据有CHAR(10),CHAR(13),CHAR(9)隐藏字符 版权声明:本文为博主原创文章,未经博主允许不得转载. https://blog.csdn.net/Givi ...
- SpringBoot2.x集成WebSocket
WebSocket 不做过多得介绍,这里有篇比较全面得文章 Spring Boot系列十六 WebSocket简介和spring boot集成简单消息代理 我这里是精简版,只挑出核心代码记录 ...