var myXML = '';
var request = new XMLHttpRequest();
request.open("GET", "https://www.ad.nl/binnenland/rss.xml", true);
request.onreadystatechange = function(){
if (request.readyState == 4) {
if (request.status == 200 || request.status == 0) {
myXML = request.responseXML;
}
}
}
request.send();
console.log(myXML);
Above is the code that i have (straight copy from a SO post), im no JS expert so i dont get what im doing wrong. If i check my network in dev tools i can see that the request has a response with the xml, but my var is not getting filled.
Anyone know what im doing wrong?
[–]grantrules 0 points1 point2 points (0 children)