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

2

6

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?

Ambages answered 5/12, 2012 at 20:34 Comment(4)
Why is this tagged jQuery instead of YUI?Trichloromethane
My bad. Thought they were also using jQuery in some way, I don't fully understand how the script works.Ambages
Why does it look like you are using both jQuery and YUI?Lupercalia
I completely missed the $(document).ready(function(){ at the top.Trichloromethane
I
6

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

Infestation answered 24/5, 2013 at 9:8 Comment(1)
For me the resolution was to move the offending JQuery method call to another place outside the parent (as suggested in third link). This problem happened only on some IE 8 browsers (possibly un-patched browsers, as suggested in first link).Queridas
B
1

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

Boynton answered 5/12, 2012 at 21:20 Comment(3)
Ok, how do I determine, with my code at: pastebin.com/iiUfMq1v When the DOM is ready?Ambages
Because then, if I know how to determine if it's ready, then I can call my code?Ambages
When using YUI, subscribe to the domReady event.Boynton

© 2022 - 2024 — McMap. All rights reserved.