Making the AJAX Request
Transforming the request URL into an AJAX request and receiving JSON. (4 min. read)
We'll cover the following...
We'll cover the following...
We left off here
And had working URL functionality.
Next step is mapping that URL to an AJAX request and collecting the JSON response.
Rename makeUrlFromInput to searchAndRenderResults and edit it to look like this.
We’ve simply renamed it and added a function that fetches the URL and logs the JSON response.
Don’t forget to change your event listener too!
Here’s our result
Looking good so far! We’re making the AJAX request and properly parsing/logging the response.
Next step is hooking it up with our UI!