$(document).ready(function() {
    // Your code here
    console.log("login.js is loaded and ready.");
    const params = new URLSearchParams(window.location.search);
    if (params.get("error")) {
        alert("Login failed. Please try again.");
    }
});

$(window).on('unload', function() {
    console.log("User is leaving login.html");
    // Your cleanup code here
});