What else do I need to add? First it was the a no header error, now its a preflight error(whatever that is). I tried turning it off via a browser plug-in as that was recommended. Error:
index.html:1 Access to XMLHttpRequest at 'http://www.quandl.com/api/v3/datasets/WORLDBANK/' from origin 'null' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.
Request:
function getMetals() {
const xhr = new XMLHttpRequest();
const url = 'http://www.quandl.com/api/v3/datasets/WORLDBANK/'
xhr.onload = function() {
if(xhr.status === 200) {
console.log('ok');
}
else {
console.log('not ok');
}
}
xhr.open('GET', url, true);
xhr.setRequestHeader('Access-Control-Allow-Origin', '*');
xhr.send();
}
getMetals();