3
I have a file index.html:
<body>
<div class="application">
<header class="header"></header>
<main class="content"></main>
<footer class="footer"></footer>
</div>
<script src="script/index.js"></script>
</body>
And I have the header, the main and the footer in separate folders. I would like to know how I can add these external files into that main file as soon as the page is loaded. I’m trying to create as pure as possible (using only HTML, CSS and JS, avoiding frameworks). But if it’s only possible with some library, I can include.
Make a include with PHP https://answall.com/questions/273072/load-html-de-other-html/273090#273090 only with HTML this can give you a light https://answall.com/questions/281023/que-recurso-finding-em-html-op%C3%A7%C3%a3o-ao-include-do-php/281044#281044 and with JS vc you can save your own. html of the other folder as a . JS and on your page you make the append of this script as the html template within something like
– hugocsl