In this exercise, we'll build a page where users can search giphy and see all the results.
Check out the slides for this lesson: // http://goo.gl/WXk5WU
Get the input value from the input field and assign it to the variable named searchTerm
You'll know it works if when you search for 'dog' it says 'Results for dog' instead of 'Results for undefined'
Build the search url in the search function
and assign it to the searchUrl variable
Hints:
- Check out the gif search api documentation
- The api key is stored in a variable
- The search term is a parameter to this function
You'll know it works when you search if the links that appears takes you to a page of search results that you can view with your JSONview chrome extension.
Update the showResults function to display the gifts on the page
First, clear the previous results.
Then add images to the results div.
You'll know it worked because you'll see gifs on the page!
If you finish that and want more, try these extensions:
- Try the sticker search api
- Show a different size image than what you have now
- Link the image back to the source
- Display the title with the image