Problems with jQuery API Get Request

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 No ‘Access-Control-Allow-Origin’ header is present on the requested resource. Origin ‘’ is therefore not allowed access.”

My code for requesting the API is:

        for (var i = 0; i<reactants.length; i++) {
          $.get("" + reactants[i], function(result) {

This is solely an excerpt of my code, my full github project can be found here

Hi njanne19,

you have to enable cors.

just add this middleware to your express app:

app.use(function(req, res, next) {
res.header(“Access-Control-Allow-Origin”, “*”);
res.header(“Access-Control-Allow-Headers”, “Origin, X-Requested-With, Content-Type, Accept”);

like mentioned here


Thank you! this fixed my problem