File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change 11window . addEventListener ( "load" , function ( ) {
2- let json = [ ] ;
2+ // let json = [];
33 fetch ( "https://handlers.education.launchcode.org/static/astronauts.json" ) . then ( function ( response ) {
44 console . log ( response ) ;
55 response . json ( ) . then ( function ( json ) {
66 const container = document . getElementById ( "container" ) ;
77 let index = 0 ;
8- container . addEventListener ( "click" , function ( ) {
8+
9+ // container.addEventListener("click", function(){
910 container . innerHTML = `
1011 <div class = "astronaut">
11- <div class = "bio">
12- <h3>${ json [ index ] . firstName , json [ index ] . lastName } </h3>
12+ <div class = "bio">
13+ <h3>${ json [ index ] . firstName } ${ json [ index ] . lastName } </h3>
1314 <ul>
1415 <li>Hours in space: ${ json [ index ] . hoursInSpace } </li>
1516 <li>Active: ${ json [ index ] . active } </li>
1617 <li>Skills: ${ json [ index ] . skills } </li>
1718 </div>
18- <img class="avatar" src="images/mae-jemison.jpg ">
19+ <img class="avatar" src="${ json [ index ] . picture } ">
1920 </div>
20-
21- ` ;
21+ ` ;
2222 index = ( index + 1 ) % json . length ;
23- < / div >
24- } ) ;
23+ // });
2524
2625 } ) ;
2726 } ) ;
You can’t perform that action at this time.
0 commit comments