From e690f7607e79d1321f69160b687f5e2d43cebce1 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 16 Aug 2021 20:27:53 -0400 Subject: [PATCH] first astronaut added, still needs additional astronauts --- script.js | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/script.js b/script.js index 0a1b374..ffd0176 100644 --- a/script.js +++ b/script.js @@ -1,8 +1,36 @@ // TODO: add code here window.addEventListener("load", function () { - this.fetch("https://handlers.education.launchcode.org/static/astronauts.json").then(function (response) { + fetch("https://handlers.education.launchcode.org/static/astronauts.json").then(function (response) { return response.json(); }) - .then() -}) \ No newline at end of file + .then(function (astronauts){ + let container = document.getElementById("container"); + container.innerHTML+= ` +
+
+

${astronauts[0].firstName} ${astronauts[0].lastName}

+
    +
  • Hours in space: ${astronauts[0].hoursInSpace}
  • +
  • Active: ${astronauts[0].active}
  • +
  • Skills: ${astronauts[0].skills}
  • +
+
+ +
+ ` + + }) +}) + +//
+/*
+

Mae Jemison

+
    +
  • Hours in space: 190
  • +
  • Active: false
  • +
  • Skills: Physician, Chemical Engineer
  • +
+
+ +
*/ \ No newline at end of file