// document.addEventListener("DOMContentLoaded", () => // { // fetch("isLoggedIn.php").then(res => res.json().then(json => // { // if (json.message !== "ok") // { // window.location.href = "index.html"; // } // else // { // document.querySelector("#title h1").innerText = "Logged in as: " + json.username; // } // })); // });