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

Added javascript2 homework week1#14

Closed
Dumie1 wants to merge 2 commits into
HackYourFuture:masterfrom
Dumie1:homework-week1
Closed

Added javascript2 homework week1#14
Dumie1 wants to merge 2 commits into
HackYourFuture:masterfrom
Dumie1:homework-week1

Conversation

@Dumie1
Copy link
Copy Markdown

@Dumie1 Dumie1 commented May 12, 2018

I have made some changes and added Javascript2 homework week1.

@harditsingh
Copy link
Copy Markdown

Hey Dumie!

Your website looks good, but the code behind it has some issues:

  • app.js: You have implemented the problem 2.4 using instances of a constructor function. This complicates things a lot. First, it would have been a lot easier to solve this problem using Object Literals. Second, your code now has static references to your data. This makes your program very rigid and you have to manually rewrite the code if you want to add another book for example. Using Object Literal would have been helpful as data can be directly loaded from JSON files and you don't have to change your code as your data varies.

  • index.html: You have added a fix number of

    and for storing the data for the books. That actually defeats the purpose of the assignment, in this assignment we aimed to load the data dynamically, we cannot prepare the HTML beforehand because we don't know how much data we have.

  • app.js: There a few more issues:

    • You code is not very well structured.
    • You haven't automated the adding of data to the HTML page using a loop, you have done that manually instead. This makes the code very rigid.
    • Same goes for the loading of images. You haven't stored the images in an array either
    • You just added an event listener to the main() function which is just adding the sources of the pictures. Your code might give an error if the rest of the JS runs before the HTML is loaded.

If you need any help regarding understanding the assignment properly, we can organize a Hangout session, just drop me a message on Slack. This would be a good time to go back to this assignment and correct your error because you don't have a class this week!

Best of luck, will wait for your message!

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