I am working with this API, which returns flight statuses originating in LHR to MAN (just an example). The response is formatted as XML, but I'm having trouble reading it with JavaScript.
I tried the following:
function loadXMLDoc(dname) { //the dname here is the url
if (window.XMLHttpRequest) {
xhttp = new XMLHttpRequest();
} else {
xhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xhttp.open("GET", dname, false);
xhttp.send();
return xhttp.responseXML;
}
But it doesn't work. Is there another way to read the XML response of the API?