Open
Conversation
devmentor-pl
approved these changes
Dec 22, 2024
Owner
devmentor-pl
left a comment
There was a problem hiding this comment.
Marku,
Całość jest ok 👍
Zostawiłem jedynie drobną uwagę dot. zadania 01 - myślę, że to pokłosie tego, o co pytałeś na Slacku :)
Comment on lines
+3
to
+6
| const dataInfoList = liElement.querySelectorAll('[data-info]'); | ||
|
|
||
| if(liElement && dataInfoList) { | ||
| console.log(`Znaleziono ${dataInfoList.length} poniższe elementy z atrybutem data-info :`); |
Owner
There was a problem hiding this comment.
Tutaj mamy drobny błąd logiczny - sprawdzasz czy element został wyszukany później niż go wykorzystujesz.
Powinno być:
const liElement = document.querySelector('.comments__item.comments__item--newest');
if(liElement) {
const dataInfoList = liElement.querySelectorAll('[data-info]');
console.log(`Znaleziono ${dataInfoList.length} poniższe elementy z atrybutem data-info :`);
}
Nie trzeba sprawdzać dataInfoList bo to tablica elementów więc nieważne czy jest ich 0 czy więcej to błędu nie będzie.
| link.setAttribute('href', url) | ||
| } | ||
| }); | ||
|
|
|
|
||
| const parentButton = document.querySelector('.parent-for-button'); | ||
| if (parentButton) { | ||
| parentButton.appendChild(button); |
| ul.appendChild(li); | ||
| }); | ||
|
|
||
| nav.appendChild(ul); No newline at end of file |
| <h1 class="article__title">JS- Nowy Artykuł</h1> | ||
| <p class="article__description">Lorem ipsum dolor sit amet consectetur adipisicing elit. Consequatur quo quibusdam, nemo neque consequuntur pariatur totam? Facere quaerat molestias hic.</p> | ||
| <button class="article__btn">Kupuję!</button> | ||
| `; No newline at end of file |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.