Last active
July 20, 2016 20:28
-
-
Save avand/1cc7721b0dd07f61ae36460533314545 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
WHEN the page loads: | |
- Get the form | |
- Add an event listener | |
WHEN the form is submitted: | |
- Prevent the default form submission | |
- Get the value of the input | |
- Add the input's value to the end of the base URL ("https://api.github.com/users/") | |
- Make an HTTP request to the full URL | |
WHEN the response comes back: | |
- Parse the JSON string response (e.g., JSON.parse(response)) | |
- Set the textContent of td#user-name to name | |
- Set the textContent of td#user-bio to bio | |
- Create an <img> | |
- Set the src attribute of the img to avatar_url | |
- Append img to td#user-picture | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment