JS error in IE8: HTML parsing error...

Source: Internet
Author: User

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; wow64; Trident/4.0; qqdownload 551; slcc2;. Net CLR 2.0.50727)
Timestamp: Wed, 12 Aug 2009 07:02:03 UTC

Message: HTML parsing error: Unable to modify the parent container element before the child element is closed (kb927917)
Row: 0
Character: 0
Code: 0

This occurs when debugging a piece of js code today .. both Firefox IE7 and IE6 are normal... depressed, I searched for related information on the Internet. Generally, an error occurs when the specified tag is not fully loaded. This object is used ....

Check the Code. On the surface, there is no problem.

As follows:

<Body>

<Script language = "JavaScript">

VaR bgobj = Document. createelement ("Div ");
Bgobj.style.css text = "position: absolute; left: 0px; top: 0px; width:" + iwidth + "PX; Height:" + math. max (document. body. clientheight, iheight) + "PX; filter: alpha (opacity = 30); opacity: 0.3; Background-color: #000000; Z-index: 101 ;";
Document. Body. appendchild (bgobj );
</SCRIPT>
</Body>

In fact, after careful check, we find that this code will run before the body is loaded ....

The problem is here ....

Therefore, the code can only be executed outside the wave voltage.

<Body>

</Body>

<Script language = "JavaScript">

VaR bgobj = Document. createelement ("Div ");
Bgobj.style.css text = "position: absolute; left: 0px; top: 0px; width:" + iwidth + "PX; Height:" + math. max (document. body. clientheight, iheight) + "PX; filter: alpha (opacity = 30); opacity: 0.3; Background-color: #000000; Z-index: 101 ;";
Document. Body. appendchild (bgobj );
</SCRIPT>

so OK is okay... it seems that the logic of IE is getting stronger and stronger... this may happen in many previous codes.

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.