這裏是我的代碼 -jQuery的附加功能在互聯網不工作Explorer 8的
$("body").append("<div>" +
"<ul>" +
"<li>" +
"<a href='javascript:void(0)' onclick='add()'>Add</a>" +
"</li>" +
"<li>" +
"<a href='javascript:void(0)' onclick='edit()'>Edit</a>" +
"</li>" +
"<li>" +
"<a href='javascript:void(0)' onclick='delete()'>Delete</a>" +
"</li>" +
"</ul>" +
"</div>");
在IE8中我得到下面的錯誤 - 你需要頁面後要做到這一點 網頁錯誤詳細信息
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)
Timestamp: Wed, 27 Mar 2013 07:03:53 UTC
Message: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Line: 0
Char: 0
Code: 0
刪除$(),只需添加元素 – Bhadra 2013-03-27 07:08:13
那是在這個問題上錯字的字符串,它糾正。 – Ashwin 2013-03-27 07:12:11
[IE中的HTML解析器問題]的可能重複(http://stackoverflow.com/questions/301484/problem-with-html-parser-in-ie) – 2013-03-27 07:17:42