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 ...
随机推荐
- 【VS开发】VS2010中导入ActiveX控件
方法1: 1.首先在在项目上面右击添加类,如下图所示: 2.点击添加ActiveX控件中的MFC类 3.找到需要添加的ActiveX类. 4.点击完成即可. 5.此时转到资源视图,打开如下视图.可能工 ...
- Ubuntu16.04安装python3.7及相应的pip
Ubuntu16.04安装python3.7及相应的pip:https://blog.csdn.net/qq_29837161/article/details/83616364 多版本Python安装 ...
- Mac 每次重启终端后配置的不生效.需要重新source
Mac 每次都要执行source ~/.bash_profile 配置的环境变量才生效 自己在 ~/.bash_profile 中配置环境变量, 可是每次重启终端后配置的不生效.需要重新执行 : $s ...
- 前端内容之CSS层叠样式表
CSS(Cascading Style Sheet层叠样式表) 把HTML认为是网页的骨架 那么CSS就是用于对HTML骨架进行修饰,比如加背景色.显示方式.位置等等属性 CSS语法形式: 一个完整的 ...
- flask内置的信号
from flask import Flask,request,template_rendered,render_template,got_request_exception from signals ...
- Highest Frequency Letters
Given a list of strings, output the most frequent characters that are in the same group as the lette ...
- [转帖]InfluxDB 1.2.0安装及新旧版本的注意事项
InfluxDB 1.2.0安装及新旧版本的注意事项 http://haibing.org/245?zwlqby=npztq3 挺好的文章 很好的解决了 上一个文档里面 关于 web admin 的问 ...
- /tmp/orbit-oracle/目录inode耗尽
[root@iZ25zpeock2Z orbit-oracle]# cd /[root@iZ25zpeock2Z /]# du -cks * |sort -nr|head -n 20du: canno ...
- spark-初阶①(介绍+RDD)
spark-初阶①(介绍+RDD) Spark是什么? Apache Spark 是一个快速的, 多用途的集群计算系统, 相对于 Hadoop MapReduce 将中间结果保存在磁盘中, Spark ...
- 数据去重 -uniq
也是经常和管道 一起操作的. -c 每行出现的次数 -d 仅仅显示重复行 -u 仅仅显示不重复行 -i 忽略大小写 注: 在对字母进行去重的时候, 一定要先对文件进行排序之后,去重的功能才可以 ...