NEED HELP - Wikipedia Viewer Project

NEED HELP - Wikipedia Viewer Project
0

#1

I’m having trouble with getting back the data after the API call. It just keeps coming back as an empty object. Any suggestions? Thanks!
CLICK HERE TO VIEW MY PROJECT


#2

I don’t know about the herokuapp URL, but you can get data from the Wikipedia API without relying on a third party application. You just need to add origin=* in the URL parameters, and you’re good to go. You also need to remove the callback bit.

// other options removed for brevity
var api = 'https://en.wikipedia.org/w/api.php?origin=*&format=json&...&srsearch='
var apiUrl = api + encodeURIComponent(query);

#3

Thank you! Yeah it works now. Just needed the origin=*