Totally new to XML and I\'ve been struggling on this very simple objective for too long (though I can find enough on the internet about it). Just need the values out of this
Your server isn't returning the appropriate Content-Type header. The responseXML property only works if the server returns a Content-Type: text/xml or similar +xml header.
See Ajax Patterns:
The service just needs to output an XML Content-type header...
From the w3c:
If final MIME type is not null, text/xml, application/xml, and does not end in +xml [...] return null.
If you have no access to the server and can't change the Content-Type header, use the overrideMimeType function to force the XMLHttpRequest to treat the response as text/xml:
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else { // IE 5/6
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.overrideMimeType('text/xml');
xhttp.open("GET", "pricing.xml", false);
xhttp.send(null);
xmlDoc = xhttp.responseXML;
var uurloon = xmlDoc.getElementsByTagName("uurloon")[0].childNodes[0].text;
var setloon = xmlDoc.getElementsByTagName("setloon")[0].childNodes[0].text
alert('end');
citation: http://blog-rat.blogspot.com/2010/11/xmlhttprequestresponsexml-returns-null.html