-
-
Notifications
You must be signed in to change notification settings - Fork 73
ITP London - Jan 2025 | Samunta Sunuwar| Module Data Flows | Book Library #203
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
base: main
Are you sure you want to change the base?
Conversation
Samunta
commented
Apr 16, 2025
- I have committed my files one by one, on purpose, and for a reason
- I have titled my PR with COHORT_NAME | FIRST_NAME LAST_NAME | REPO_NAME | WEEK
- I have tested my changes
- My changes follow the style guide
- My changes meet the requirements of this task
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.
Good job!
I think some of the code can still use some improvement.
debugging/book-library/index.html
Outdated
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.
Good job in fixing most of the errors in the HTML code.
According to https://validator.w3.org/, there are still some errors in the HTML code. Can you fix these errors?
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.
Thank you for your feedback, I have made changes as requested.
debugging/book-library/script.js
Outdated
title.value == null || | ||
title.value == "" || | ||
//adding author validation | ||
author.value == null || | ||
author.value == "" || | ||
pages.value == null || | ||
pages.value == "" | ||
) { |
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.
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.
Thank you for your feedback, I have made changes as requested.
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.
Thank you for your feedback, I have made changes as requested.
debugging/book-library/script.js
Outdated
}); | ||
// fixed: using one consistent button variable | ||
let delButton = document.createElement("button"); | ||
delButton.id = `delete-${i}`; // optional: clearer ID |
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.
Great job in recognizing the need to ensure unique id value.
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.
Thank you
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.
-
Line 76:
- The current method of assigning book titles to HTML elements can cause display issues if a title contains special character sequences like
<i>
.
- The current method of assigning book titles to HTML elements can cause display issues if a title contains special character sequences like
-
Can you suggest a more consistent naming convention for the variables representing the two buttons, currently named
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.
Thank you for your feedback, I have made changes as requested.
…<input> element is a void element, which means it should not have a closing tag (like </input>)
…and used .trim to ensure no white spaces are being added. Also added validation to reject input with negative or decimal numbers
…ows instantly, instead of triggering multiple reflows with deleteRow.