-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmaps.html
37 lines (25 loc) · 800 Bytes
/
maps.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
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html>
<body>
<h2>The XMLHttpRequest Object</h2>
<p id="demo">Let AJAX change this text.</p>
<button type="button" onclick="loadDoc()">Change Content</button>
<script>
function loadDoc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var data = JSON.parse(this.responseText);
for (i of data.list){
console.log(i.coord.lon),
console.log(i.coord.lat)
} // End of Loop
}
}; // End of XML Call back Function
city_id =""
xhttp.open("GET", "http://api.openweathermap.org/data/2.5/group?id=5128581,4140963&units=metric&appid=64597b3665f4c8b9f918b0da999890ad", true);
xhttp.send();
}
</script>
</body>
</html>