Hello!
How can i parse a document with a text/html header as a xml document with jQuery?
Thanks in advance
Hello!
How can i parse a document with a text/html header as a xml document with jQuery?
Thanks in advance
use ajax request to get the page data and treat it like text data..
$.get(URL, params, function(data) {
//process the data here
});
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..