File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change 1+ <!DOCTYPE html>
2+ < html lang ="en ">
3+ < head >
4+ < meta charset ="UTF-8 ">
5+ < title > Type Ahead 👀</ title >
6+ < link rel ="stylesheet " href ="style.css ">
7+ </ head >
8+ < body >
9+
10+ < form class ="search-form ">
11+ < input type ="text " class ="search " placeholder ="City or State ">
12+ < ul class ="suggestions ">
13+ < li > Filter for a city</ li >
14+ < li > or a state</ li >
15+ </ ul >
16+ </ form >
17+ < script src ="day-06.js "> </ script >
18+ </ body >
19+ </ html >
Original file line number Diff line number Diff line change 1+ // Get the data
2+ const endpoint = 'https://gist.githubusercontent.com/Miserlou/c5cd8364bf9b2420bb29/raw/2bf258763cdddd704f8ffd3ea9a3e81d25e2c6f6/cities.json' ;
3+
4+ // Create an empty array for the cities
5+ const cities = [ ] ;
6+
7+ // Promises return as a promise
8+ // const prom = fetch(endpoint);
9+ // console.clear();
10+ // console.log(prom);
11+
12+ fetch ( endpoint )
13+ . then ( blob => blob . json ( ) )
14+ . then ( data => cities . push ( ...data ) )
15+
16+ console . clear ( ) ;
17+ console . log ( cities ) ;
You can’t perform that action at this time.
0 commit comments