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

Skip to content

Squirtlehomework #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
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.