Update static/login.html
Browse files50 unmodified lines51525354555556575858596160616263646566676869707150 unmodified lines<script> // --- FIX: Wait for the page to load before trying to find elements --- document.addEventListener('DOMContentLoaded', () => { console.log("DOM fully loaded and parsed. Initializing script.");
// Since this file is served from the same origin as the API, no base URL is needed. const API_BASE_URL = '';
// --- FIX: Declarations are now INSIDE the listener --- const loginForm = document.getElementById('loginForm'); const signupBtn = document.getElementById('signupBtn'); const loginBtn = document.getElementById('loginBtn'); const loginBtn = document.getElementById('loginBtn'); // This is the line that finds the button const messageEl = document.getElementById('message');
// --- CRUCIAL DEBUGGING STEP --- // This will tell us if the button was found or not. console.log("Attempting to find buttons..."); console.log("Login button element:", loginBtn); console.log("Signup button element:", signupBtn);
// --- LOGIN LOGIC --- loginForm.addEventListener('submit', async (e) => { e.preventDefault();static/login.html+8-3