Editor multi-function text box on some computers can not load properly, the solution, I use the JS call method to put in <body></body> behind)

Source: Internet
Author: User

IE8 "HTML parsing error:unable to modify the parent container element before the child element is closed" error

One

and see the IE8 report the following error, and is my machine does not report, colleague's machine newspaper, tried 4 units, two newspaper, two do not report, IE version are the same, did not want to understand the solution:

1, see if there are not closed HTML tags, such as <table> without </table> (I am the reason) 2, whether the page is not loaded before the JS code operation of the body elements, the relevant JS code to move to </body> Behind
Page Error Details
User agent: mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1;  trident/4.0; SLCC2;. NET CLR 2.0.50727;. NET CLR 3.5.30729;. NET CLR 3.0.30729; Media Center PC 6.0) Timestamp: Wed, APR 08:33:56 UTC
Message: HTML parsing error:unable To modify the parent container element before the child element is closed (KB927917) line: 0 words Character: 0 Code: 0 URI:
http://support.microsoft.com/kb/927917

Two

It occurs because some DOM operations occur before the DOM tree is loaded, such as AppendChild

Just like the following code:

When parsing to the div begins to appendchild on the body, and this time the body is still not fully ready (It is not fully loaded), the document structure is still between the loading and interactive state, so you will get the above error. Of course, the error is now known to exist in IE6 and IE7 two versions (not tested below IE6), in IE8 will get an HTML parsing error: HTML parsing error:unable to modify the parent container element before the child element is closed (KB927917)

1. To solve this problem, you can make a document.readystate state judgement, when it is complete and then do the appropriate action, or add the script tag defer attribute (this property is not supported in IE8).

2. Or

JS added SetTimeout ("xxxx ()", 1000), so that it gets enough load time to execute the target (XXXX) function, so the problem is resolved

Editor multi-function text box on some computers do not load properly, the solution, I use the JS call method to put in <body></body> back)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.