const params = new URLSearchParams(window.location.search); const palina = params.get('palina'); const targetID = params.get('targetID'); const selectedOption = params.get('selectedOption'); console.log(palina, targetID, selectedOption); // 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}`; function caricadati(){ fetch(urlBackend) .then(res => res.json()) .then(data => { const container = document.getElementById('tabella-container'); container.innerHTML = ''; if (!data || data.length === 0) { container.textContent = 'Nessun dato trovato.'; return; } // Creo tabella const table = document.createElement('table'); // Intestazione const thead = document.createElement('thead'); thead.innerHTML = `