After dealing with styling issues, wrapping my mind around querying Wikipedia’s API, and overcoming the dreaded CORS error… I’ve reached yet another stumbling block.
Regardless of what I put into the field of my , my code displays [object Object] on the page where I want it to display properties of the JSON object I queried for. When I go to my Dev Tools in Chrome and check out the Network, it looks like the query is executing according to the user’s input. And it looks like it’s receiving a JSON object in response. But on the page, I just see [object Object]. When I try to access any of the object’s properties (e.g. json.query.pages.title), I get the following error: “Uncaught TypeError: Cannot read property ‘title’ of undefined.”
I’m not sure what I’m missing here, and I would really appreciate some help. Here’s my pen: