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

user1879703 picture user1879703 · Dec 5, 2012 · Viewed 15.1k times · Source

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?

Answer

Dilip Rajkumar picture Dilip Rajkumar · May 24, 2013

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..