This repository was archived by the owner on Oct 26, 2020. It is now read-only.
week 8 home work done#1009
Open
Iman-feisali wants to merge 2 commits intoCodeYourFuture:manchester3from
Open
Conversation
Dedekind561
reviewed
Jul 2, 2020
| .then(function (data) { | ||
| return data.json(); | ||
| }) | ||
| .then(function (newLink) { |
There was a problem hiding this comment.
Great variable name newLink - always good to see 😄
| .then(function (response) { | ||
| return response.text(); | ||
| }) | ||
| .then(function (greeting) { |
There was a problem hiding this comment.
Good variable name. All seems to be working fine to me
| return data.json(); | ||
| }) | ||
| .then(function (newLink) { | ||
| makeImage.src = newLink.message; |
There was a problem hiding this comment.
Ensure that any image you append onto the document also has an alt attribute too
| makeImage.src = newLink.message; | ||
| }) | ||
| .catch((error) => { | ||
| console.log(error); |
There was a problem hiding this comment.
Maybe here you could also think about displaying an error message in case something goes wrong
| @@ -0,0 +1,16 @@ | |||
| fetch("https://xkcd.now.sh/?comic=latest") | |||
| .then(function (data) { | |||
| if (data.ok) { | |||
There was a problem hiding this comment.
Interesting that it has this ok property - I've never seen that before
| }) | ||
| .then(function (newData) { | ||
| const newImage = document.getElementById("image"); | ||
| newImage.src = newData.img; |
There was a problem hiding this comment.
Again don't forget the alt attribute here, Iman
| <!-- Write your answer here --> | ||
| <!-- | ||
| {owner} = octocat | ||
| {repo} = Hello-World |
| 2. Describe in a sentence what this API endpoint returns when all of the fields are completed? | ||
|
|
||
| <!-- Write your answer here --> | ||
| <!-- Provides details for a review comment. I havn't catch that much --> |
There was a problem hiding this comment.
Yeah exactly - looks to me like a pull request
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Your Details
Your Name: Iman
Your City: Manchester
Your Slack Name: Iman-feisali
Homework Details
Module: JavaScript
Week: 8