Not getting JSON output after pressing enter to search

Mind taking a look at this? I could really use a hand on this one. Thanks.

Hi Kimberly,

Modify your form handler like in the section below. This will let you output to the console the entire data object returned from the wiki api call.

That will let you find the properties you need. E.g. the snippet is under:[_index_].snippet

Note that forms fire a “submit” event on Enter/Return, so you can switch from your keydown() to submit(). You will however need to use e.preventDefault() to prevent your page from reloading after the submit.

  $('#search').submit(function(e) {

    searchQuery = document.getElementById('textInput').value;
    }).done(function(data) {
      // document.getElementById("title").value= JSON.stringify(data);
      // document.getElementById("snippet").value=search[0].snippet;
      // document.getElementById("snippet").value=data[3][1];

Thanks! I got it fixed and a better understanding of what I’m doing on the project.