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

相關文章
相關標籤/搜索