Upload files to "js"

This commit is contained in:
daniele 2025-06-24 08:52:30 +00:00
parent e6183a48e2
commit c3c46a7209
1 changed files with 9 additions and 3 deletions

View File

@ -5,9 +5,10 @@ const selectedOption = params.get('selectedOption');
console.log(palina, targetID, selectedOption);
// Esempio URL backend che ritorna JSON { linea, destinazione, veicolo, soppressa }
const urlBackend = `http://URL-API/?param=${targetID}&param2=${selectedOption}&palina=${palina}`;
const urlBackend = `https://api.vichingo455.freeddns.org/start-fermatebus.json/?param=${targetID}&param2=${selectedOption}&palina=${palina}`;
fetch(urlBackend)
function caricadati(){
fetch(urlBackend)
.then(res => res.json())
.then(data => {
const container = document.getElementById('tabella-container');
@ -55,4 +56,9 @@ fetch(urlBackend)
.catch(err => {
console.error('Errore nel caricamento dati:', err);
document.getElementById('tabella-container').textContent = 'Errore nel caricamento dati.';
});
});
}
caricadati();
setInterval(caricadati, 60000);