//https://css-tricks.com/the-simplest-ways-to-handle-html-includes/ // fetch("./includes/header.html") // .then(response => { // return response.text() // }) // .then(data => { // document.querySelector(".header").innerHTML = data; // }); //pages fetch("../includes/nav.html") .then(response => { return response.text() }) .then(data => { var container = document.querySelector(".include-nav"); if (container) { container.innerHTML = data; } }); // //home // fetch("./includes/nav.html") // .then(response => { // return response.text() // }) // .then(data => { // document.querySelector("nav-home").innerHTML = data; // }); // fetch("./includes/contact.html") // .then(response => { // return response.text() // }) // .then(data => { // document.querySelector(".contact-home").innerHTML = data; // });