-
-
Notifications
You must be signed in to change notification settings - Fork 61
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
London-ITP-Jan2025| Sabita Shrestha| Module-Data-Flows| Book-library| week2 #185
base: main
Are you sure you want to change the base?
London-ITP-Jan2025| Sabita Shrestha| Module-Data-Flows| Book-library| week2 #185
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there are some improvements you can still make to the JS code.
Also, when I checked the code in index.html
at https://validator.w3.org/, it indicated some errors.
debugging/book-library/script.js
Outdated
for (let n = rowsNumber - 1; n > 0; n-- ){ | ||
table.deleteRow(n); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of deleting the table rows one by one, can you think of a more efficient way to remove all rows (except the <th>...</th>
) in the table?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of input validation,
- Are all input properly checked?
- Can
.value
benull
? (Do we need to checksomeInputElement.value == null
?) - What if a user enters only space characters in the "title" input field?
- What if a users enters
-1
or3.1416
in the "pages" input field?
With the way the book's title is assigned to an HTML element (line 69), a book with a title containing special character sequence such as <i>
can possibly ruin the display.
Lines 75, 89:
- Is the value assigned to these
id
attribute unique? - Is there a need to assign an id attribute to
delButton
? - Is there a need to assign an id attribute to
changeBut
(at line 72)?
Lines 74, 88:
- Can you think of a more consistent way to name the variables representing the two buttons,
changeBut
anddelButton
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, thank you for your review. I have made the changes as mentioned; could you please review my work and let me know if anything needs to be adjusted? Thank you.
On separate note, the May I suggest learning the "importance to fill the PR template in a Github PR" via Google search or ChatGPT? |
Changes to the JS code look great! Wonderful job. (Can consider also fix the error in HTML when you have time). Feel free to mark this as "Complete" anytime. |
Learners, PR Template
Self checklist
Changelist
Briefly explain your PR.
Questions
Ask any questions you have for your reviewer.