Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
csathnere authored Aug 8, 2024
1 parent f9da0bf commit efba8fd
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/demo.html
Original file line number Diff line number Diff line change
@@ -1 +1,21 @@
<script>
// footer and content page load
document.addEventListener("DOMContentLoaded", () => {
const components = [
// { id: "content-page", url: "pages/content-page.html" },
{ id: "footer", url: "footer/footer.html" },
];

components.forEach((component) => {
fetch(component.url)
.then((response) => response.text())
.then((data) => {
document.getElementById(component.id).innerHTML = data;
})
.catch((error) =>
console.error(`Error loading ${component.url}:`, error)
);
});
});
// end -footer
</script>

0 comments on commit efba8fd

Please sign in to comment.