JSON
помогите понять как достучатся к объекту и его свойствам.
я пытаюсь закинуть данные с файла styles.json в showMoreStyles.js
не могу понять как вынять именно
"src"
"title"
"link"
с каждого объекта и вставить в
card.innerHTML = `
<div class="styles-block">
<img src=${src} alt="style">
<h4>${title}</h4>
<a href=${link}>Подробнее</a>
</div>
`;
я понимаю что здесь ${src}нужно вставить какой то путь, но какой?
может я как-то не так response прописываю?....
помоги пжл)
Applications 2
-
Приветствую!
Сделаю быстро и качественно
Обращайтесь - буду рад сотрудничеству
-
447 2 0 Добрый день, могу помочь, недавно переносил данные из 500 файлов JSON в excel таблицу, обращайтесь
-
1446 115 2 1 Здравствуйте, готов помочь, обращайтесь
____________________________________________
-
3124 88 3 4 Здравствуйте, Антон
Готов вам помочь получить данные из json.
С уважением, Юрий
-
item.src item.title item.link
Если захотите отблагодарить карту могу скинуть в личку)
-
var styles=[ {
"src": "assets/img/styles-5.jpg",
"title": "Пастелью",
"link": "#pastel"
},
{
"src": "assets/img/styles-6.jpg",
"title": "Поп-арт",
"link": "#popart"
},
{
"src": "assets/img/styles-7.png",
"title": "Фотомозаика",
"link": "#mozaika"
},
{
"src": "assets/img/styles-8.jpg",
"title": "Шарж",
"link": "#sharj"
}
];
for(var key in styles){
/*выводим каждый src*/
console.log(styles[key]['src'])
}
Есть еще вариант , попробовала ваш массив обектов
-
Current freelance projects in the category JavaScript
Exchange service
510 USD
There are working exchangers, it is necessary to rely on the example, make a cryptocurrency exchanger: Design and code can be taken completely from a working website, that is - make a copy. The exchange rate and other data for the exchange - what I could set manually. The… JavaScript, Web programming ∙ 2 proposals |
Writing software for creating an Open Book on the Solana network
107 USD
During the creation of interchangeable tokens (SPL token) on the Solana network, it is necessary to automate the process of creating an Open Book for the token and speed it up by increasing transaction fees. Software functions: - Create Open Book - Set a "tea" limit on the… Java, JavaScript |
Website layout according to the design.
510 USD
Good day. There is a layout in Figma: https://www.figma.com/file/RGVIymprYc4QaiJ5qp3iwL/LayerGame?type=design&node-id=0-1&mode=design There is a UI kit and a ready-made layout of the Main page, implemented in React, animations are done using GSAP. It is necessary to layout 2… HTML and CSS, JavaScript ∙ 34 proposals |
ParallaxIt is necessary to make such a parallax as here https://www.bangbangforever.com/#artists, that is, a video block video (everything is already laid out) and also part of the parallax is ready, stack Next.js JavaScript ∙ 1 proposal |
Set up Facebook Pixel and Google Analytics events on the websiteSet up Facebook Pixel and Google Analytics events on the website. Do this through the website admin panel, simply add scripts there or through GTM. JavaScript, Web programming ∙ 7 proposals |