Answer the question
In order to leave comments, you need to log in
Why does the function not find (does not see) the object?
What am I doing wrong, why doesn't the function find (see) the object?
The data is transferred from the module to the current js file in order to insert the necessary data (links) into the template with pictures.
Template code (index.html):
<div class="popup__pictures">
<img src="" class="popup__picture" width="45" height="40" alt="Картинка жилья">
</div>
import {createAdverts} from './util.js';
const advertElement = template.cloneNode(true);
const similarAdverts = createAdverts(1);
const popupPictures = advertElement.querySelector('.popup__pictures');
const imgPopupPictures = advertElement.querySelector('.popup__picture');
popupPictures.textContent = '';
const getPicture = (advert) => {
for (let ind = 0, img; ind <= offer.pictures.length -1; ind++) {
img = imgPopupPictures.cloneNode();
img.src = offer.picture[ind];
popupPictures.appendChild(img);
}
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question