You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 14, 2024. It is now read-only.
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!
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
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.
I have made some changes and added Javascript2 homework week1.