diff --git a/static/index.js b/static/index.js index a46c7e6..acea543 100644 --- a/static/index.js +++ b/static/index.js @@ -11,6 +11,10 @@ function load_links() { select.appendChild(option); i++; }); + }) + .catch((error) => { + alert("Errore nel caricamento dei dati, riprova più tardi."); + console.error("Error:", error); }); } @@ -28,6 +32,10 @@ function load_teachers(id) { list.appendChild(option); i++; }); + }) + .catch((error) => { + alert("Errore nel caricamento dei dati, riprova più tardi."); + console.error("Error:", error); }); } @@ -49,6 +57,10 @@ function load_classes(id) { select.appendChild(option); } sessionStorage.setItem("classes", JSON.stringify(data)); + }) + .catch((error) => { + alert("Errore nel caricamento dei dati, riprova più tardi."); + console.error("Error:", error); }); } @@ -80,6 +92,10 @@ function make_teacher_table(id, teacher) { tbody.appendChild(tr); }); table.appendChild(tbody); + }) + .catch((error) => { + alert("Errore nel caricamento dei dati, riprova più tardi."); + console.error("Error:", error); }); } @@ -111,6 +127,10 @@ function make_student_table(id, student_class) { tbody.appendChild(tr); }); table.appendChild(tbody); + }) + .catch((error) => { + alert("Errore nel caricamento dei dati, riprova più tardi."); + console.error("Error:", error); }); }