views:

53

answers:

2

Hello!

How can i parse a document with a text/html header as a xml document with jQuery?

Thanks in advance

A: 

use ajax request to get the page data and treat it like text data..

$.get(URL, params, function(data) {

    //process the data here

});
sathis
A: 

xmlString = ""; //GET string via ajax or whatever the case might be

if (window.DOMParser){
  parser=new DOMParser();
  xmlDoc=parser.parseFromString(xmlString,"text/xml");
}
else {  // For IE
  xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
  xmlDoc.async="false";
  xmlDoc.loadXML(xmlString); 
}

Hope that helps..

conqenator