Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Script Error: Unable to modify the parent container element before the child element is closed

Script Error: Unable to modify the parent container element before the child element is closed. What should I do? I click Yes, and my web page isn't displayed.

At the beginning of my Product page code, I have: http://pastebin.com/iiUfMq1v

Everything works fine in every browser except IE8, that is the only browser that is throwing any sort of error.

Any ideas?

like image 559
user1879703 Avatar asked Dec 05 '12 20:12

user1879703


2 Answers

Please check these links

http://answers.microsoft.com/en-us/ie/forum/ie8-windows_other/html-parsing-error-unable-to-modify-the-parent/e64759e0-d344-42d6-b1d8-0ce27504dd71

http://afewguyscoding.com/2010/03/message-html-parsing-error-unable-to-modify-the-parent-container-element-before-the-child-element-is-closed-kb927917/

Basically it will happen when you try to update a element by javascript which is the parent of current element or the element does not render at all. I faced this issue and fixed by running the script after the page loads. i.e inside $(document).ready()

hope this helps someone..

like image 137
Dilip Rajkumar Avatar answered Sep 30 '22 08:09

Dilip Rajkumar


IE has historically not allowed the DOM to be modified until after the domReady event.

like image 39
John Lindal Avatar answered Sep 30 '22 06:09

John Lindal