一、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"错误的更多相关文章

  1. 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 ...

  2. 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 ...

  3. [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 ...

  4. 工作日志,error parsing query: unable to find time zone

    工作日志,error parsing query: unable to find time zone 坑 Windows 系统使用influxdb数据库,在执行查询语句时提示 ERR: error p ...

  5. ERROR: Unable to globalize '/usr/local/NONE/etc/php-fpm.d/*.conf' 问题的解决

    今天继续作大死,趟php7的配置的坑. 照例,安装了昨天的各种扩展之后,解压php7的压缩文件到 /usr/local/. 然后开始配置config的扩展: ./configure --prefix= ...

  6. 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 ...

  7. 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 ...

  8. [nodejs] Error: unable to verify the first certificate

    Error: unable to verify the first certificate Solution npm config set registry http://registry.npmjs ...

  9. Error: unable to connect to node rabbit@mail: nodedown

    某天,开启一个应用时,发现连接rabbitmq失败,本来想用rabbitmqctl来查看队列,结果提示“Error: unable to connect to node rabbit@mail: no ...

随机推荐

  1. 20190925 - 使 macOS 的 rm 命令删除到回收站的不完美办法

    今天使用 macOS 时,使用 rm 删除了一个不重要文件,为保证以后不删除重要文件,找到一个让 rm 命令更安全的办法. 使用 MacPorts 安装 rmtrash 命令. sudo port i ...

  2. 20190603 - CentOS 7 提示 Failed to load SELinux policy. Freezing 导致卡住不启动的解决办法

    现象 最近 Windows 和两台 Mac 混用,将 Windows VirtualBox 中安装的 CentOS 7 拷贝到 Mac 上. 启动 CentOS 7 时,图形界面进度卡在最后,按 Es ...

  3. javaweb期末项目-stage1-part2-UML设计

    UML设计.rar-下载 说明:解压密码为袁老师全名拼音(小写) 相关链接: 项目结构:https://www.cnblogs.com/formyfish/p/10828672.html 需求分析:h ...

  4. C学习笔记-字符串的格式化输出和输入

    存储方式 字符串是内存中一段连续的char空间,以'\0'结尾 字符串就是0结尾的连续char的内存 '\0' <=> 0 <=> null printf函数,putchar函 ...

  5. ZOJ Problem Set - 1003

    1.翻译参考 http://www.cnblogs.com/woodfish1988/archive/2006/11/10/556926.html 2.代码参考 http://www.cnblogs. ...

  6. [图像分割] OpenCV 的 GrabCut 函数使用和源码解读

    转自 zouxy09 GrabCut 原理参考这里,以下为 GrabCut 源码: ——看别人写的好的代码也很享受,干净利落,有些处理的细节也学习一下. /*M//////////////////// ...

  7. [转帖]k8s.gcr.io/pause的作用

    k8s.gcr.io/pause的作用 https://blog.51cto.com/liuzhengwei521/2422120 weilovepan520关注0人评论196人阅读2019-07-2 ...

  8. Oracle - 函数及多表关联

    函数一般是在数据上执行的,它给数据的转换和处理提供了方便.只是将取出的数据进行处理,不会改变数据库中的值.函数根据处理的数据分为单行函数和聚合函数(组函数),组函数又被称作聚合函数,用于对多行数据进行 ...

  9. Spring的四种事务特性,五种隔离级别,七种传播行为

    Spring事务: 什么是事务: 事务逻辑上的一组对数据对操作,组成这些操作的各个逻辑单元,要么一起成功,要么一起失败. 事务特性(4种): 原子性(atomicity):强调事务的不可分割:一致性( ...

  10. 从入门到自闭之Python--MySQL数据库的多表查询

    多表查询 连表: 内连接:所有不在条件匹配内的数据们都会被剔除连表 select * from 表名1,表名2 where 条件; select * from 表名1 inner join 表名2 o ...