Skip to content

Commit b17b932

Browse files
author
Justin Ramel
committed
WIP fetch cities
1 parent 8e1e7e6 commit b17b932

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

06 - Type Ahead/index-START.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,14 @@
1414
<li>or a state</li>
1515
</ul>
1616
</form>
17-
<script>
18-
const endpoint = 'https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json';
1917

20-
</script>
18+
<script>
19+
const endpoint = 'https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json';
20+
let cities = []
21+
fetch(endpoint)
22+
.then(response => response.json())
23+
.then(json => cities = json)
24+
.then(_ => console.log(cities))
25+
</script>
2126
</body>
2227
</html>

0 commit comments

Comments
 (0)