Skip to content
This repository was archived by the owner on May 14, 2024. It is now read-only.

adding homework js3-w1#21

Closed
ghost wants to merge 1 commit into
masterfrom
unknown repository
Closed

adding homework js3-w1#21
ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost
Copy link
Copy Markdown

@ghost ghost commented Jun 11, 2018

Hi,
Please review my work.
Thanks - Mudar

Copy link
Copy Markdown

@harditsingh harditsingh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great job Mudar, your app looks very good and works well! I have some comments though which you should improve in the next assignment, please read the comments below.

<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="Style.css" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow your CSS file was not linked, turns out that stylesheet is 'style.css' and not 'Style.css' (yep, the value for the source is case-sensitive)

Comment thread Week1/js3-hw-w1/app.js

function callback(error, data) {
if (error !== null) {
} else {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You didn't handle the error! If the server is unreachable, the page doesn't load at all. This isn't the best thing to do as the user would be wondering what happened. You should put text on the page saying that there was an error retrieving the data from the server.

Comment thread Week1/js3-hw-w1/app.js
repo.forEach(repo => {
const option = createAndAppend('option', select);
option.innerHTML = repo.name;
option.setAttribute('value', repo.name);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You forgot to sort the elements of the list in an alphabetical order!

Comment thread Week1/js3-hw-w1/app.js

function repoInfo(repoName) {
const urlContributor = 'https://api.github.com/repos/HackYourFuture/' + repoName + '/contributors';
const repoUrl = 'https://api.github.com/repos/HackYourFuture/' + repoName;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not put static links inside functions, you should save these strings in a variable and then get the value from the variable. The way you did it gets the work done, but it will cause problems when you try to change the link (and forget to change it on some places).

Comment thread Week1/js3-hw-w1/app.js
repoName.innerHTML = 'repo: &nbsp;&nbsp;&nbsp;' + repoInfo.name;
forks.innerHTML = 'Forks: &nbsp;&nbsp;&nbsp;' + repoInfo.forks_count;
updated.innerHTML = 'Updated: &nbsp;&nbsp;&nbsp;' + repoInfo.updated_at;
p.innerHTML = 'Description: &nbsp;&nbsp;&nbsp;' + repoInfo.description;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You shouldn't use spaces, tabs, etc. to format the text on the webpage, always use CSS for this. (Can you please correct this in the next assignment when you get time?)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants