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 Здравствуйте, готов помочь, обращайтесь
____________________________________________
-
3698 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
I am looking for an experienced Full Stack developer to create a SaaS service for online stores.Service idea: The client uploads a link to their product feed (XML or CSV). The service automatically retrieves the products, takes their photos, and creates new advertising images based on ready-made templates: price, discount, logo, promotional tags, etc. There should also be… Javascript and Typescript, Web Programming ∙ 2 days 1 hour back ∙ 82 proposals |
Development of a WebGL/Three.js scene with generation and export of 3D (snapshot) from an animated shaderObject Description:The project is a designer table shaped like a realistic, deep whirlpool (a central vortex that smoothly transitions from a wide horizontal tabletop to a thin elegant leg). Task Essence:A WebGL / Creative Coding developer is required to create an interactive 3D… Javascript and Typescript, Web Programming ∙ 2 days 21 hours back ∙ 30 proposals |
Support and development of the cleaning company's website
20 USD
I'm looking for a web developer/webmaster for long-term support and development of a cleaning company's website. Website: https://donely.ca About the project DoneLy Home Services is a cleaning service company in Canada that is actively growing and expanding its geographical… Javascript and Typescript, Web Programming ∙ 4 days 23 hours back ∙ 64 proposals |
Development of a website according to the specifications on FramerYou need to create a website based on the parameters in the technical specification. https://docs.google.com/document/d/1ODO2C9Krb4AaMiJz9wfbNzWlAyA2FwCCHL8r0biajUY/edit?usp=sharing Please provide your actual rate based on this design. HTML & CSS, Javascript and Typescript ∙ 6 days back ∙ 29 proposals |
Development of an interactive Palworld map for the websiteWe need to develop an interactive map for Palworld based on the example: https://palworld.gg/map We need not just a static image, but a full-fledged interactive map where users can view locations, toggle object categories on/off, search for specific points, and interact with… HTML & CSS, Javascript and Typescript ∙ 7 days 15 hours back ∙ 36 proposals |
