jquery - Parse html/text document as XML? -


How can I parse a document with a text / html headers as an XML document with jQuery?

  xmlString = ""; // Get string through AJAX or whatever the case may be (window.DOMParser) {parser = new DOMParser (); XmlDoc = parser.parseFromString (xmlString, "text / xml"); } Else {// IE for xmlDoc = New ActiveXObject ("Microsoft.XMLDOM"); XmlDoc.async = "false"; XmlDoc.loadXML (xmlString); }  

Hope that helps ..


Comments