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 ...
随机推荐
- web赛题
@php反序列化漏洞https://www.freebuf.com/news/172507.html @巅峰极客wp https://www.anquanke.com/post/id/189142 @ ...
- vue点击编辑按钮,内容变成input可以修改,也可以删除
一.效果 图1 图2,点击报错之后,又变成图1的效果 二.使用到了element UI中的以下组件: <el-button> <el-input> 三.使用的关键点是vue中的 ...
- ip地址查询python3小工具_V0.0.1
看到同事在一个一个IP地址的百度来确认导出表格中的ip地址所对应的现实世界的地址是否正确,决定给自己新开一个坑.做一个查询ip“地址”的python小工具,读取Excel表格,在表格中的后续列输出尽可 ...
- 【LOJ】#3093. 「BJOI2019」光线
LOJ#3093. 「BJOI2019」光线 从下到上把两面镜子合成一个 新的镜子是\((\frac{a_{i}a_{i + 1}}{1 - b_{i}b_{i + 1}},b_{i} + \frac ...
- 20190507-学习dubbo有感于梁飞
“作为一名程序员,BAT肯定是大多数人都想进的,仿佛是一种情愫,就像学生时代的我们对清华北大的向往感觉一样.Dubbo团队中,其中主要负责人就是梁飞了,梁飞的经历还是蛮励志的.梁飞,花名虚极, 200 ...
- TUM 慕尼黑工业大学 MSEI 课程结构介绍 ws19/20
本文内容 根据德文 tum 官网介绍:https://www.ei.tum.de/studium/master-ei-msei/ 翻译,提取并且翻译成中文信息. 本文适用于ws19/20届的学生. 概 ...
- 小白必看的Python爬虫流程
定义: 网络爬虫(Web Spider),又被称为网页蜘蛛,是一种按照一定的规则,自动地抓取网站信息的程序或者脚本. 简介: 网络蜘蛛是一个很形象的名字.如果把互联网比喻成一个蜘蛛网,那么Spider ...
- X86逆向2:提取按钮通杀特征码
本章我们将学习特征码的提取与定位,特征码是软件中一段固定的具有标志性的代码片段,特征码的用途非常广泛,最常见的就是杀毒软件的查杀了,查杀就是根据特征码定位技术实现的,再比如木马的免杀也是修改了特征码的 ...
- 链表分割——牛客剑指offer
题目描述: 编写代码,以给定值x为基准将链表分割成两部分,所有小于x的结点排在大于或等于x的结点之前 给定一个链表的头指针 ListNode pHead,请返回重新排列后的链表的头指针.注意:分割以后 ...
- jvm GC:垃圾回收的测试与分析
实验环境: (1)Java版本以及模式: java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0 ...