The problem is in assigning my “apiUrl” variable, if you look at the console I print out what it gives me and I don’t see where I’m going wrong. Any help would be appreciated, thanks!
$.getJson is an asynchronous function. Basically it requests some data and let’s the code go further while it waits for a response - the data to arrive.
$.getJSON("url", function(data) {
// this is the code that runs when you receive data - after request finishes
});
// this is the code that will run first - before request finishes