Skip to content

task to lesson 3 - #9

Open
zagidulin wants to merge 1 commit into
masterfrom
JS_2_les_3
Open

task to lesson 3#9
zagidulin wants to merge 1 commit into
masterfrom
JS_2_les_3

Conversation

@zagidulin

Copy link
Copy Markdown
Owner

No description provided.

@Tardigrada777 Tardigrada777 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

В целом отлично, но я рекомендую обратить особое внимание на форматирование кода, аккуратность, пробелы и отступы и проч.

Comment thread basket_script.js
// для инициализации возможности удаления изменения количесвта товара при "раскрытии" корзины
if (this.shopCartList.length > 0) {
let changeShopCart = document.querySelector('.basket_container');
changeShopCart.addEventListener('click', (event) => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Не самое эффективное решение. Рекомендую обратить внимание на стратегию делегирования событий. https://learn.javascript.ru/event-delegation

Comment thread basket_script.js
this.shopCartList = [];
}

_getShopCartList() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Да, уже лучше)

Comment thread task_2.js

function makeGETRequest (url, callback) {
let xhr;
if (window .XMLHttpRequest) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Между именем объекта и точкой пробел не ставится.

Comment thread task_2.js
this.goods = [];
}

fetchGoods(cb) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отлично, прокинули колбек в метод!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants