@sahil_malik ,
when making AJAX calls through CodePen you are dealing with what is known as a CORS request I would recommend you read the following sources (they will help you overcome your issue):
There is an open ticket here: https://phabricator.wikimedia.org/T62835
If you wish to use the Media Wiki API, you have to use JSONP format.
I understand many people are confused about this, I was as well. How can I suggest to freeCodeCamp they do something about this? They should really include this information on their Wikipedia Viewer challenge, as this information runs contrary to this link: https://www.mediawiki.org/wiki/API:Cross-site_requests that freeCodeCamp puts up on the challenge pa…
Hi everyone,
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:
https://codepen.io/heenslice/pen/VzGQMe?editors=0010
When …
http://lupecamacho.com/wikipedia-viewer-wikipedia-api-cross-origin-request-issues/