If you refresh your page now, you should see another error. In your console, expand out the response object so you can read the exact error:
We forgot to search for anything! That's easy enough to solve. If you look at the documentation for the cooperhewitt.search.objects method here, you can see that there are all sorts of different ways we can search for objects. For this example, let's just use the general query parameter. Update your ajaxData variable so that it contains a key named "query" with the value of "computer".
Refresh the page one last time and let's see what we've got:
And we can start expanding this object to see what's in there:
The result is a combination of everything we've covered so far: objects, arrays, strings, numbers... it goes on and on. You will certainly want to take advantage of console.log for this assignment so you can see what you're working with.
From here, what will you want to do to complete you assignment? It comes down to input and output. We hard coded the example above to just take the word "computer" as a query parameter. How is your interface going to give users a way to control what information we send to the API (input)? And once we get the data back from the API, what is your interface going to do with it (output)?
Home