fetch('/assets/views/header.html') .then(response => response.text()) .then( resultText => document.getElementById('header').innerHTML = resultText ); fetch('/assets/views/footer.html') .then(response => response.text()) .then( resultText => document.getElementById('footer').innerHTML = resultText );