Update static/login.html
Browse files50 unmodified lines5152535455565758596061626364656650 unmodified lines<script>// --- FIX: Wait for the page to load before trying to find elements ---document.addEventListener('DOMContentLoaded', () => {// 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 messageEl = document.getElementById('message');// --- LOGIN LOGIC ---loginForm.addEventListener('submit', async (e) => {e.preventDefault();50 unmodified lines51525354555657585960616263646566676869707150 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.");const API_BASE_URL = '';const loginForm = document.getElementById('loginForm');const signupBtn = document.getElementById('signupBtn');const loginBtn = document.getElementById('loginBtn'); // This is the line that finds the buttonconst 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