document.addEventListener('DOMContentLoaded', function () { fetch('/sitesources/html/header.html') .then(response => { if (!response.ok) { throw new Error('Network response was not ok'); } return response.text(); }) .then(data => { const headerPlaceholder = document.getElementById('header-placeholder'); if (headerPlaceholder) { headerPlaceholder.innerHTML = data; } }) .catch(error => { console.error('Error loading header:', error); }); });