Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
week-12 done
  • Loading branch information
hol23003 committed Apr 15, 2024
1 parent fb81c12 commit e00cfe0
Show file tree
Hide file tree
Showing 3 changed files with 47,263 additions and 1 deletion.
36 changes: 36 additions & 0 deletions json-demo/index.html
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>JSON Demo</title>
</head>
<body>
<section id="pokemon">

</section>


<script>
let pokemonSection = document.querySelector("#pokemon");

fetch("pokedex_raw_array.json").then(response => {
return response.json();
}).then(pokemon => {

// array of pokemon objects
for(let i = 0; i < 10; i++) {
let name = pokemon[i].name;
pokemonSection.innerHTML += `
<article>
<figure>
<img src="${pokemon[i].image_url}" alt="${pokemon[i].name}">
<figcaption>${pokemon[i].name}</figcaption>
</figure>
</article>`
}
});

</script>
</body>
</html>

0 comments on commit e00cfe0

Please sign in to comment.