mirror of
https://github.com/Daniongithub/ER-TPL.git
synced 2025-10-02 22:50:47 +00:00
added refresh
This commit is contained in:
@@ -7,7 +7,8 @@ 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}`;
|
||||||
|
|
||||||
fetch(urlBackend)
|
function caricadati(){
|
||||||
|
fetch(urlBackend)
|
||||||
.then(res => res.json())
|
.then(res => res.json())
|
||||||
.then(data => {
|
.then(data => {
|
||||||
const container = document.getElementById('tabella-container');
|
const container = document.getElementById('tabella-container');
|
||||||
@@ -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);
|
Reference in New Issue
Block a user