') or $ .parseXML ('')? I found that $ ('') reorganizes the attributes and assigns th...">

When creating XML with jQuery should use $ ('<xml / ">') or $ .parseXML ('<xml /">')?

I found that $ ('') reorganizes the attributes and assigns the xml namespace, but $ .parseXML () preserves the integrity of the original xml string. I am not sure what is good.

+4
source share
1 answer

According to the documentation for parseXML

jQuery.parseXML uses the built-in browser parsing function to create a valid XML document. You can then pass this document to jQuery to create a typical jQuery object that you can move and manipulate.

So, if you are trying to create an XML document, you would like to use parseXML .


Per Esailija, you can make $($.parseXML(xml)) and go through an XML document using jQuery. Do not pass the string directly, as xml is interpreted as html will have different rules. For example, in html, the param tag should be a closing tag.
+4
source

All Articles