Hello all.
So I currently am working on an individual project that requires an API Call. I am using jQuery to do so, and below I have pasted my code. However, I am getting the error in chrome console saying:
“XMLHttpRequest cannot load https://enthalpy-api.herokuapp.com/6H2O(l). No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘http://127.0.0.1:3000’ is therefore not allowed access.”
My code for requesting the API is:
for (var i = 0; i<reactants.length; i++) {
$.get("https://enthalpy-api.herokuapp.com/" + reactants[i], function(result) {
numbersReactants.push(result);
console.log(numbersReactants);
});
}
This is solely an excerpt of my code, my full github project can be found here