1
0
Fork 0

Video 57: Browser HTTP Requests with Fetch

This commit is contained in:
Jason Williams 2019-10-10 12:13:01 -06:00
parent 4fc267d599
commit 9dcb792e18
1 changed files with 12 additions and 1 deletions

View File

@ -1 +1,12 @@
console.log('Client side javascript file is loaded!')
console.log('Client side javascript file is loaded!')
fetch('/weather?address=boston').then((response) => {
response.json().then((data) => {
if (data.error) {
console.log(data.error)
} else {
console.log(data.location)
console.log(data.forecast)
}
})
})