I recently finished the all the intermediate projects. However I ran into CORs issues on all of them. I found the simplest fix when working was to add a chrome extension that allowed CORS. Although I recognise this isn’t the best practice.
After a bit of research I found out the you could add ‘format=json&origin=*’ to the query parameters of your URL request. This worked for all projects except the wikipedia viewer here:
When transferring my code from codepen to my local text editor and opening the file there are also no CORS issues. It seems to be related to codepen. So any ideas how I can fix the CORS issues in this codepen?
As you notice, I added the prop info with the url. You can avoid the entire getPageUrls function and have your urls in the first and only $.get.
Then, use the loop you already have ( Object.entries(searchResults).forEach(([key, value]) =>{ ) to iterate through the returned object and you should be set.