diff --git a/script.js b/script.js index 9417030..c111ea5 100644 --- a/script.js +++ b/script.js @@ -1 +1,24 @@ -// TODO: add code here \ No newline at end of file +// TODO: add code here +window.addEventListener("load", function() { + fetch("https://handlers.education.launchcode.org/static/astronauts.json"). then(function(response) { + response.json() .then(function(json) { + for (let i = 0; i < json.length; i++) { + const container = document.getElementById("container"); + container.innerHTML += + ` +
+
+

${json[i].firstName} ${json[i].lastName}

+ +
+ +
+ `; + } + }); + }); +}); \ No newline at end of file