 method: "POST",
                body: formData
            })
            .then(response => response.json())
            .then(data => {
                window.location.href = `/output.html?date=${data.date}&time=${data.time}`;
            })
            .catch(error => {
                document.getElementById("loading").classList.add("hidden");
                alert("An error occurred. Please try again.");
                console.error("Error:", error);
            });
        });
    </scri