HTML Parsing Error KB927917
为什么80%的码农都做不了架构师?>>>
它的发生,是因为某些DOM操作发生在DOM树加载完成之前,比如appendChild
就像下面的代码:
<html>
<head>
</head>
<body>
<div>
<script type="text/javascript">
alert(document.readyState);
var oDiv = document.createElement("DIV");
oDiv.innerHTML = 'test odiv test odiv';
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("XXXX()",1000);,使其获得足够的加载时间后执行目标(XXXX)的function,于是问题得到解决
转载于:https://my.oschina.net/psuyun/blog/277515
HTML Parsing Error KB927917相关推荐
- windows7浏览器无法打开html,win7网页无法打开出现HTML Parsing Error的解法
win7系统下网页无法打开,提示此网页上的错误提示"HTML Parsing Error: Unable to modify the parent container element bef ...
- HTML Parsing Error: Unable to modify the parent container element before the chi
网页错误详细信息 用户代理: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 2.0.50727; . ...
- OTS parsing error: invalid version tag woff和ttf文件被Filter拦截
从服务器下载的字体文件放在本地,执行无法展示iconfont,浏览器控制台报出 Failed to decode downloaded font: http://127.0.0.1:8080/mhr/ ...
- springboot : Failed to decode downloaded font 和 OTS parsing error
大家好,我是烤鸭: 采坑实录,看了很多人跟我有类似问题,但是都没解决我的问题: Failed to decode downloaded font 和 OTS parsing error: 尝试了把wo ...
- 【解决问题】OpenCV(3.4.1) Error: Parsing error (xx.yaml(13): Incorrect indentation) in icvYMLParseValue
本博客运行环境为Ubuntu18.04 下 Kdevelop. 运行slam的一个cpp文件时,错误描述如下: OpenCV(3.4.1) Error: Parsing error (KITTI00- ...
- Vue使用Eslint报“Parsing error: x-invalid-end-tag“错误的解决方案
Vue2中Eslint报"Parsing error: x-invalid-end-tag"错误的解决方案 问题原因 vue将标签渲染为原生html标签时,由于这些标签是自闭合的, ...
- Parsing error: No Babel config file detected for
Parsing error: No Babel config file detected for的相关错误 上述不行就下面这个,一般上面图片的可以
- Maven — maven filtering OTS parsing error incorrect file size in WOFF head 产生原因及两种解决方案
背景说明 前端静态资源文件放在后端SpringBoot项目resources文件夹下,多环境打包后前端页面出现了图标及文字未按预期样式显示的情况,查看浏览器控制台发现出现如下错误. OTS parsi ...
- eslint报错Parsing error: Unexpected token prettier/prettier
问题描述 index.html文件首行 eslint 报错Parsing error: Unexpected token prettier/prettier caused by "<! ...
- Parsing error: Cannot read file ‘c:\users\xxx\desktop\demo\tsconfig.json‘
问题描述 nest,按照官方文档走的, 刚搭好得的框架,每个文件开头报错了,但是能运行起来,只不过有个爆红看着属实不舒服 Parsing error: Cannot read file 'c:\use ...
最新文章
- golang 数组和切片
- python入门需要多久-怎么自学python,大概要多久?
- excel公式 某一个单元格等于另一个单元格的值_15个excel小技巧,简单易学,一看就会,收藏备用吧...
- [转载][总结]函数getopt(),getopt_long及其参数optind
- 使用ABBYY FineReader进行自动图像预处理
- JDK 9.0.4 报错:程序包 com.sun.xml.internal.fastinfoset.stax.events 不存在/不可见
- Android浏览器速度测试,Android平台浏览器网页加载速度对比评测
- miui游戏驱动程序偏好设置_米粉必看:小米官方教你如何关闭 MIUI 广告 - 小米,MIUI...
- 大型网站架构演变和知识体系【转载】
- 【学习与理解】:CTPN算法
- 智慧工厂数字化生产管理系统软件
- 谈谈网络协议,常见的网络协议有那些?
- springboot中@SpringBootApplication的扫描范围,以及多模块的扫描问题
- MySQL高级SQL语句
- WinPcap笔记:VisualStudio2015配置WinCap
- NOIP模拟 字符处理(送分or送命?)
- 数据库原理 头歌实训 数据库常用对象
- ios设置音乐audio自动播放
- 2022年全球市场智能纺织品总体规模、主要生产商、主要地区、产品和应用细分研究报告
- Intellij Idea 好用插件之GsonFormat