Skip to content

Commit 589ccb6

Browse files
committed
HTML Exercises
1 parent 4de5881 commit 589ccb6

File tree

5 files changed

+36
-1
lines changed

5 files changed

+36
-1
lines changed

fetch/chapter-examples/fetching-data/fetch-weather-part-1.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ <h1>Launch Status</h1>
1616
Weather Conditions
1717
<div id="weather-conditions">
1818
<!-- TODO: dynamically add html about weather using data from API -->
19+
1920
</div>
2021
</body>
2122
</html>

fetch/studio/index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@
88
</head>
99
<body>
1010
<script src="script.js"></script>
11+
1112
<h1>Astronauts</h1>
1213
<div id="container">
1314
<!-- List of astronauts will be added here dynamically -->
15+
1416
</div>
1517
</body>
1618
</html>

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: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
//TODO: Add Your Code Below
1+
window.addEventListener("load", function() {
2+
fetch("https://handlers.education.launchcode.org/static/astronauts.json").then( function(response) {
3+
response.json().then( function(json) {
4+
const div = document.getElementById('container');
5+
//loop
6+
div.innerHTML = `
7+
<ul>
8+
<li>id ${json.id}</li>
9+
<li>active ${json.active}</li>
10+
<li>firstName ${json.firstName}</li>
11+
<li>lastName ${json.lastName}</li>
12+
<li>skills ${json.skills}</li>
13+
<li>hoursInSpace ${json.hoursInSpace}</li>
14+
<li>picture ${json.picture}</li>
15+
</ul>
16+
`;
17+
});
18+
});
19+
});

html/exercises/index.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,16 @@
99
</head>
1010
<body>
1111
<!-- h1 goes here -->
12+
<h1>Why I Love Web Development</h1>
1213
<!-- ol goes here -->
14+
<ol>
15+
<li>It is creative</li>
16+
<li>It is logical</li>
17+
<li>It is under the trans pipeline. JK. </li>
18+
</ol>
1319
<!-- a goes here -->
20+
<a href="https://education.launchcode.org/intro-to-web-dev-curriculum/html/exercises/index.html" target="_blank">LaunchCode</a>
1421
<!-- p goes here -->
22+
<p>I am going to make a website about Lucid Dreaming. I have so much I can say about it so I have to focus on one thing. I might describe my path with lucid dreaming and how I progressed throughout the years.</p>
1523
</body>
1624
</html>

0 commit comments

Comments
 (0)