blob: 4526e5e36f35bfc19be8f503482845bb04eef1d7 (
plain)
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
|
function update() {
var data;
fetch('/latest')
.then(function(resp) {
return resp.json();
})
.then(function(response) {
data = response;
var table = document.querySelector('#latest').children;
table[0].textContent = data.TimeStamp;
table[1].textContent = data.Co;
table[2].textContent = data.No;
table[3].textContent = data.So;
})
.catch(function(error) {
console.log(error);
});
}
setInterval(update, 60000);
|