-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
25 lines (23 loc) · 844 Bytes
/
script.js
File metadata and controls
25 lines (23 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
async function getResponce() {
let responce = await fetch("dance.json")
let content = await responce.text()
console.log(content)
content = JSON.parse(content)
content = content.splice(0, 10)
console.log(content)
let key
for (key in content) {
console.log(content[key].id, content[key].title)
console.log(content[key])
}
let node_for_insert = document.getElementById("node_for_insert")
for (key in content) {
node_for_insert.innerHTML += `
<li style="width: 210px" class="d-flex flex-column m-1 p-1 border bg-body">
<img style="width: 180px" class="align-self-center" src=${content[key].image}>
<h5 class="card-title">${content[key].title}</h5>
<p class="card-text">${content[key].description}.</p>
</li> `
}
}
getResponce()