Dwr convertXml bug

Source: Internet
Author: User

Read the engine. js source code of dwr and see the convertXml method:
[Xhtml: showcolumns]
··· · 50 ······· · 90 ····· · 140 · 150
/**
* Marshall an object
* @ Private
* @ See dwr. engine. serialize. convert () for parameter details
*/
ConvertXml: function (batch, referto, data, name, depth ){
Var output;
If (window. XMLSerializer) output = new XMLSerializer (). serializeToString (data );
Else if (data. toXml) output = data. toXml;
Else output = data. innerHTML;
Return "xml:" + encodeURIComponent (output );
}

XMLSerializer is used, which is not supported in IE6.
ToXml, ff, and ie6 are all undefined. It is estimated that it is the method name for custom xml Conversion.
The last data. innerHTML is for html dom objects.
If the uploaded object is a constructed xml object, it is constructed as follows:
[Xhtml: showcolumns]
··· · 50 ······· · 90 ····· · 140 · 150
Function stringToXML (xmlData ){
If (window. ActiveXObject ){
// For IE
XmlDoc = new ActiveXObject ("Microsoft. XMLDOM ");
XmlDoc. async = "false ";
XmlDoc. loadXML (xmlData );
Return xmlDoc;
}
Else
If (document. implementation & document. implementation. createDocument ){
// For ILA
Parser = new DOMParser ();
XmlDoc = parser. parseFromString (xmlData, "text/xml ");
Return xmlDoc;
}
}

In this way, the test is successful only in ff. The method XMLSerializer is executed, and an error is reported in IE6,
I checked it online. ie9 mentioned above supports XMLSerializer.
Haha... The younger brother looks at the source code and test results. I don't know if there is anything wrong with it. If so, please point it out. Thank you?

From lazy Tom

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.