In IE, the solution of javascript coding for KB927917 is generated.

Source: Internet
Author: User

I recently encountered such a problem in programming.

 

Code

Online shopping website

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0 ;. net clr 1.1.4322 ;. net clr 3.0.04506.648 ;. net clr 3.5.21022 ;. net clr 2.0.50727 ;. net clr 3.0.20.6.2152 ;. net clr 3.5.30729)
Timestamp: Tue, 30 Mar 2010 01:42:50 UTC

Warning: HTML Parsing Error: Unable to modify the parent container element before the child element is closed (KB927917)
Row: 0
Character: 0
Program quota: 0
URI: http: // localhost: 2322/ScheduleModel/Pages/SignMemberMaintain. aspx? CertificateKey = i9BmNO8EiDtUNbfbzY0W9sWk9QiNfmfrPG3hDrhtxIfenjYvmmTkkQ % 3d &

 

 

The generation of this example is as follows:

 

Code

Var msgw, msgh, bordercolor;
Msgw = 400;
Msgh = 100;
Titleheight = 25
Bordercolor = "" #336699 "";
Titlecolor = "" #99 CCFF "";

Var bgObj = document. createElement ("div "");
BgObj. setAttribute ("" id "", "" bgDiv "");
BgObj. style. position = "" absolute "";
BgObj. style. top = document. getElementById ('"+ UpdatePanel1.ClientID + @"'). offsetTop + "" px ""
BgObj. style. background = "" #777 "";
BgObj. style. filter = "" progid: DXImageTransform. Microsoft. Alpha (style = 3, opacity = 25, finishOpacity = 75 "";
BgObj. style. opacity = "" 0.6 "";
BgObj. style. left = document. getElementById ('"+ UpdatePanel1.ClientID + @"'). offsetLeft + "" px ""
BgObj. style. width = document. getElementById ('"+ UpdatePanel1.ClientID + @"'). offsetWidth + "" px ""
BgObj. style. height = document. getElementById ('"+ UpdatePanel1.ClientID + @"'). offsetHeight + "" px ""
BgObj. style. zIndex = "" 10000 "";
Document. getElementById ('"+ UpdatePanel1.ClientID + @"'). appendChild (bgObj );

Var msgObj = document. createElement ("" div "");
MsgObj. setAttribute ("" id "", "" msgDiv "");
MsgObj. setAttribute ("" align "", "" center "");
MsgObj. style. background = "" white "";
MsgObj. style. border = "1px solid" "+ bordercolor;
MsgObj. style. position = "" absolute "";
MsgObj. style. left = "" 50% "";
MsgObj. style. top = "" 50% "";
MsgObj. style. font = "" 12px/1.6em Verdana, Geneva, Arial, Helvetica, sans-serif "";
MsgObj. style. marginLeft = ""-225px "";
MsgObj. style. marginTop = -7520.document.doc umentElement. scrollTop + "" px "";
MsgObj. style. width = msgw + "" px "";
MsgObj. style. height = msgh + "" px "";
MsgObj. style. textAlign = "" center "";
MsgObj. style. lineHeight = "25px "";
MsgObj. style. zIndex = "" 10001 "";
Document. body. appendChild (msgObj );

Var txt = document. createElement ("" p "");
Txt. style. margin = "" 1em 0 ""
Txt. setAttribute ("" id "", "" msgTxt "");
Txt. innerHTML = "" incomplete metadata during initialization. Please do not operate! "";
Document. getElementById ("" msgDiv ""). appendChild (txt );

 

 

I already have Highlight. it is preliminarily believed that when the Body has not been processed, a new element is added to It (It is not fully loaded ).

At this time, the document is located between loading and interactive loading.

 

Solution:

 

1. first, document. readyState then judges when it is complete and then performs the corresponding operation, or add the defer encoding to the script tag (this encoding is not supported in IE8 ).

$ (Document). ready (function (){
// In this example, your generation...
});

 

Or

 

2. setTimeout ("XXXX ()", 1000); is added to javascript, so that it can obtain the function of configuring the row mark (XXXX) after the hour.

 

 

Related Article

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.