added refresh
This commit is contained in:
parent
f9d0ddc88a
commit
4c74b2f557
|
@ -7,6 +7,7 @@ console.log(palina, targetID, selectedOption);
|
||||||
// Esempio URL backend che ritorna JSON { linea, destinazione, veicolo, soppressa }
|
// Esempio URL backend che ritorna JSON { linea, destinazione, veicolo, soppressa }
|
||||||
const urlBackend = `https://api.vichingo455.freeddns.org/start-fermatebus.json/?param=${targetID}¶m2=${selectedOption}&palina=${palina}`;
|
const urlBackend = `https://api.vichingo455.freeddns.org/start-fermatebus.json/?param=${targetID}¶m2=${selectedOption}&palina=${palina}`;
|
||||||
|
|
||||||
|
function caricadati(){
|
||||||
fetch(urlBackend)
|
fetch(urlBackend)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
|
@ -56,3 +57,8 @@ fetch(urlBackend)
|
||||||
console.error('Errore nel caricamento dati:', err);
|
console.error('Errore nel caricamento dati:', err);
|
||||||
document.getElementById('tabella-container').textContent = 'Errore nel caricamento dati.';
|
document.getElementById('tabella-container').textContent = 'Errore nel caricamento dati.';
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
caricadati();
|
||||||
|
|
||||||
|
setInterval(caricaDati, 60000);
|
Loading…
Reference in New Issue