IE8脚本错误解决:HTML Parsing Error: Unable to modify the parent container element before the child element

今天碰到一个问题,后台添加的一个js脚本,在ie8下会报出以下错误:javascript

HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)html

 

奇怪的只有同事的机器有问题,个人机器没问题,搜索一番,终于解决。大概代码以下java

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
......
</head>
<body>
    <form>
        ......
        ......
        <script language='javascript'>alert('没有可导出的数据!');</script>
    </form>
</body>
</html>    

 问题就出在js代码的问题,答题缘由是由于脚本出如今为闭合的标签之间。orm

解决方法也很简单,把脚本放到</body>以后就能够了。xml

 

若是你不是开发人员,只是一个用户,遇到这个问题,就须要打一个补丁了(KB2416400),下载地址:htm

http://www.microsoft.com/zh-cn/download/details.aspx?id=11262,不过,这个我没有验证,不敢保证百分百有效。blog

 

 

参考资料:ip

http://www.wbsz.com/html/25546.htmlelement

相关文章
相关标签/搜索