mirror of
https://github.com/GolemEmpoli/zerocalcare.git
synced 2024-09-27 15:34:06 +00:00
[F.END] Strict JS
This commit is contained in:
parent
8ab956242d
commit
3b78c37a47
@ -1,10 +1,10 @@
|
|||||||
|
"use strict";
|
||||||
function zerocalcareDisplay() {
|
function zerocalcareDisplay() {
|
||||||
|
const zerocalcareOutput = document.getElementById('zerocalcareOutput');
|
||||||
|
|
||||||
zerocalcareOutput = document.getElementById('zerocalcareOutput');
|
if (this.readyState == 4 && this.status == 200) {
|
||||||
|
|
||||||
if (xhr.readyState == 4 && xhr.status == 200) {
|
var json_obj = JSON.parse(this.responseText);
|
||||||
|
|
||||||
var json_obj = JSON.parse(xhr.responseText);
|
|
||||||
|
|
||||||
if (json_obj.length == 0) {
|
if (json_obj.length == 0) {
|
||||||
zerocalcareOutput.childNodes[0].textContent = 'Nessun appuntamento in programma';
|
zerocalcareOutput.childNodes[0].textContent = 'Nessun appuntamento in programma';
|
||||||
@ -116,9 +116,8 @@ function zerocalcareDisplay() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function zerocalcareTrigger() {
|
function zerocalcareTrigger() {
|
||||||
xhr = new XMLHttpRequest();
|
const xhr = new XMLHttpRequest();
|
||||||
xhr.onload = zerocalcareDisplay;
|
xhr.onload = zerocalcareDisplay;
|
||||||
xhr.open('GET', 'https://golem.linux.it/cgi/zerocalcare/main.py?interval=4weeks', true);
|
xhr.open('GET', 'https://golem.linux.it/cgi/zerocalcare/main.py?interval=4weeks', true);
|
||||||
xhr.send(null);
|
xhr.send(null);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user