This commit is contained in:
plane000
2018-07-10 20:11:24 +01:00
parent 1c2adf84c7
commit 57e091c134
22 changed files with 2309 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
async function update() {
let celsius = document.getElementById('celsius').checked;
let lat = document.getElementById('lat').value;
let long = document.getElementById('long').value;
if (lat == '' || long == '') {
document.getElementById('Currently').innerHTML ='You have not enterd any coordinates';
return;
}
let http = new XMLHttpRequest();
http.onreadystatechange = function() {
document.getElementById('Currently').innerHTML = 'loading...';
let response = this.responseText;
document.getElementById('Currently').innerHTML = response;
}
let string = '/weather?lat=' + lat + '&long=' + long;
if (!celsius) {
string += '&celsius=false'
}
await http.open('GET', string, true);
await http.send();
}