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 таблицу, обращайтесь
-
1005 115 2 1 Здравствуйте, готов помочь, обращайтесь
____________________________________________
-
3777 111 3 5 Здравствуйте, Антон
Готов вам помочь получить данные из 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 and Typescript
Full-stack development — Amazon PPC Dashboard (Stage 1)Need a full-stack developer with experience working with Amazon API to implement Stage 1 of the internal PPC dashboard. The project is real, the data is live, everything is ready to start. Frontend prototype (5 pages, React + TypeScript): WHAT IS ALREADY READY — Frontend… Javascript and Typescript, Web Programming ∙ 5 hours 20 minutes back ∙ 10 proposals |
Development of a photo book and photo frame constructor websiteProject Goal A modern website needs to be developed for ordering photo books, photo frames, and other personalized photo products. The main task of the project is to provide the client with the ability to independently create a ready-made layout of the product directly on the… Javascript and Typescript, Web Programming ∙ 1 day 21 hours back ∙ 88 proposals |
Full-stack developmentNeed a full-stack developer who is free for work and not looking to get rich immediately from this project. This is my test site: readyhome.ge the prototype of which I want to create (not referring to design). In the footer, there is Russian language, fill out the questionnaire… Javascript and Typescript, Web Programming ∙ 2 days 10 hours back ∙ 79 proposals |
Team for a custom marketplace of funeral services.We are looking for a team to launch and develop a custom national marketplace for funeral services. Right away: we are not looking for solo freelancers, juniors, or "website builders." We need a strong product team at the middle+/senior level with real cases in… Javascript and Typescript, Web Programming ∙ 2 days 15 hours back ∙ 25 proposals |
Improvement of the existing Next.js/Supabase project: offers, CRM, analytics, AI chatThere is an active project WatchGenius — a luxury watch analytics platform with a catalog of models, price analytics, external offers, application forms, and an AI chat. The project has already been partially developed. We need not a website from scratch, but an experienced… Javascript and Typescript, Web Programming ∙ 4 days 17 hours back ∙ 54 proposals |
