Thanks to visit codestin.com
Credit goes to github.com

Skip to content
16 changes: 16 additions & 0 deletions Week2/homework/squirtle-sprites.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,19 @@ function fetchPokemonData() {
}

/* Code goes below */

const data = fetchPokemonData();

function sprites() {
const myObj = JSON.parse(data);
const spritesObj = myObj.sprites;
for (const key in spritesObj) {
if (spritesObj[key] !== null) {
const image = document.createElement('img');
image.src = spritesObj[key];
document.querySelector('p').appendChild(image);
}
}
}

sprites();
15 changes: 15 additions & 0 deletions Week2/homework/squirtleparade.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!DOCTYPE html>
<html>

<head>
<title>Squirtle Parade!</title>
<style>
</style>
</head>

<body>
<p></p>
<script type='text/javascript' src='squirtle-sprites.js'></script>
</body>

</html>
28 changes: 21 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.