-
Notifications
You must be signed in to change notification settings - Fork 0
/
vid-66.html
26 lines (24 loc) · 842 Bytes
/
vid-66.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<script>
// javascript can be used to send or retreive information from the network when needed(AJAX)
// fetch is used to get data over the network
let p = fetch("https://goweather.herokuapp.com/weather/Ny")
p.then((response)=>{
console.log(response.status)
console.log(response.ok)
// console.log(response.text)
// if we do response.text we can not do .json then also .json gives javascript object while .text gives string
return response.json()
}).then((value)=>{
console.log(value)
})
</script>
</body>
</html>