Update static/login.html
Browse files- static/login.html +8 -3
static/login.html
CHANGED
|
@@ -51,16 +51,21 @@
|
|
| 51 |
<script>
|
| 52 |
// --- FIX: Wait for the page to load before trying to find elements ---
|
| 53 |
document.addEventListener('DOMContentLoaded', () => {
|
|
|
|
| 54 |
|
| 55 |
-
// Since this file is served from the same origin as the API, no base URL is needed.
|
| 56 |
const API_BASE_URL = '';
|
| 57 |
|
| 58 |
-
// --- FIX: Declarations are now INSIDE the listener ---
|
| 59 |
const loginForm = document.getElementById('loginForm');
|
| 60 |
const signupBtn = document.getElementById('signupBtn');
|
| 61 |
-
const loginBtn = document.getElementById('loginBtn');
|
| 62 |
const messageEl = document.getElementById('message');
|
| 63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 64 |
// --- LOGIN LOGIC ---
|
| 65 |
loginForm.addEventListener('submit', async (e) => {
|
| 66 |
e.preventDefault();
|
|
|
|
| 51 |
<script>
|
| 52 |
// --- FIX: Wait for the page to load before trying to find elements ---
|
| 53 |
document.addEventListener('DOMContentLoaded', () => {
|
| 54 |
+
console.log("DOM fully loaded and parsed. Initializing script.");
|
| 55 |
|
|
|
|
| 56 |
const API_BASE_URL = '';
|
| 57 |
|
|
|
|
| 58 |
const loginForm = document.getElementById('loginForm');
|
| 59 |
const signupBtn = document.getElementById('signupBtn');
|
| 60 |
+
const loginBtn = document.getElementById('loginBtn'); // This is the line that finds the button
|
| 61 |
const messageEl = document.getElementById('message');
|
| 62 |
|
| 63 |
+
// --- CRUCIAL DEBUGGING STEP ---
|
| 64 |
+
// This will tell us if the button was found or not.
|
| 65 |
+
console.log("Attempting to find buttons...");
|
| 66 |
+
console.log("Login button element:", loginBtn);
|
| 67 |
+
console.log("Signup button element:", signupBtn);
|
| 68 |
+
|
| 69 |
// --- LOGIN LOGIC ---
|
| 70 |
loginForm.addEventListener('submit', async (e) => {
|
| 71 |
e.preventDefault();
|