Skip to content

Commit cdabec8

Browse files
committed
studio completed
1 parent c2dee1a commit cdabec8

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

fetch/studio/package-lock.json

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

fetch/studio/script.js

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,30 @@
1+
12
//TODO: Add Your Code Below
3+
4+
5+
6+
window.addEventListener("load", function() {
7+
8+
fetch("https://handlers.education.launchcode.org/static/astronauts.json").then(function(response){
9+
response.json().then(function(data){
10+
for (let i=0; i<data.length; i++){
11+
let astronaut = data[i];
12+
container.innerHTML +=`
13+
<div class="astronaut">
14+
<div class="bio">
15+
<h3>${astronaut.firstname} ${astronaut.lastName}</h3>
16+
<ul>
17+
<li>Hours in space: ${astronaut.hoursInSpace}</li>
18+
<li>Active: ${astronaut.active}</li>
19+
<li>Skills: ${astronaut.skills}</li>
20+
</ul>
21+
</div>
22+
<img class="avatar" src=${astronaut.picture}>
23+
</div>
24+
25+
`;
26+
}
27+
});
28+
29+
});
30+
});

0 commit comments

Comments
 (0)