diff --git a/public/scripts/common.js b/public/scripts/common.js index 4096b69..3032bb1 100644 --- a/public/scripts/common.js +++ b/public/scripts/common.js @@ -16,10 +16,10 @@ async function loadHeaderFooter() { const myAccountTemplate = document.getElementById('my-account-template'); if (isLoggedIn) { - headerElement.innerHTML += myAccountTemplate.content.cloneNode(true); + headerElement.appendChild(myAccountTemplate.content.cloneNode(true)); } else { - headerElement.innerHTML += loginTemplate.content.cloneNode(true); + headerElement.appendChild(loginTemplate.content.cloneNode(true)); } const footerResponse = await fetch('https://commonhtml.thepenguinontheweb.tech/footer-snippet.html');