Wiki Viewer App won't display getJSON data

So I can’t seem to figure out how the getJSON data that the function retrieves.
the console,logs the json data in a multidimensional array,but I can’t seem to access it using the usual methods.

the append method doesn’t seem to do a lot.

on line 9 in your js code -


open the codepen console, what’s in there?

It gives a array like


can you copy and paste url for the codepen

this is the link to the codepen…I hope you can make some sense of it.

When you submit a form, the page refreshes. So, what’s happening is your code is right, but the page refreshes before you can see the result. In order to prevent the page from refreshing, you need to include event.preventDefault() in your submit handler. Like so:

$(document).ready(function() {
  $("#formData").submit(function(event) {
    var searchTerm = $("#Search").val();
    var url = "" + searchTerm + "&limit=5&format=json&callback=?";
    event.preventDefault(); //  this is what was missing :)
    $.getJSON(url, function(data) {


Yes thank you very much,this seems to work now.I will now try to finish the rest of it.
Thanks again.

1 Like