File tree Expand file tree Collapse file tree 1 file changed +31
-3
lines changed Expand file tree Collapse file tree 1 file changed +31
-3
lines changed Original file line number Diff line number Diff line change 11// TODO: add code here
22window . addEventListener ( "load" , function ( ) {
3- this . fetch ( "https://handlers.education.launchcode.org/static/astronauts.json" ) . then ( function ( response ) {
3+ fetch ( "https://handlers.education.launchcode.org/static/astronauts.json" ) . then ( function ( response ) {
44 return response . json ( ) ;
55
66 } )
7- . then ( )
8- } )
7+ . then ( function ( astronauts ) {
8+ let container = document . getElementById ( "container" ) ;
9+ container . innerHTML += `
10+ <div class="astronaut">
11+ <div class="bio">
12+ <h3>${ astronauts [ 0 ] . firstName } ${ astronauts [ 0 ] . lastName } </h3>
13+ <ul>
14+ <li>Hours in space: ${ astronauts [ 0 ] . hoursInSpace } </li>
15+ <li>Active: ${ astronauts [ 0 ] . active } </li>
16+ <li>Skills: ${ astronauts [ 0 ] . skills } </li>
17+ </ul>
18+ </div>
19+ <img class="avatar" src="${ astronauts [ 0 ] . picture } ">
20+ </div>
21+ `
22+
23+ } )
24+ } )
25+
26+ // <div class="astronaut">
27+ /* <div class="bio">
28+ <h3>Mae Jemison</h3>
29+ <ul>
30+ <li>Hours in space: 190</li>
31+ <li>Active: false</li>
32+ <li>Skills: Physician, Chemical Engineer</li>
33+ </ul>
34+ </div>
35+ <img class="avatar" src="images/mae-jemison.jpg">
36+ </div> */
You can’t perform that action at this time.
0 commit comments