footer: add footer loader

This commit is contained in:
2026-06-03 03:42:39 +07:00
parent b7c10621b1
commit 42429b1509
29 changed files with 39 additions and 101 deletions
@@ -377,7 +377,8 @@
<!-- Footer Component -->
<div id="footer"></div>
<script src="productPages/productMain/productMain.js"></script>
<script src="productPages/productMain/productMain.js?v=1.0"></script>
<script src="/components/header/headerLoader.js"></script>
<script src="/components/footer/footerLoader.js"></script>
</body>
</html>
@@ -1,10 +1,4 @@
////views/productPages/productMain/productMain.js
// Load footer
fetch("components/footer/footer.html")
.then((response) => response.text())
.then((data) => {
document.getElementById("footer").innerHTML = data;
});
// Product page specific JavaScript
document.addEventListener("DOMContentLoaded", function () {
@@ -36,7 +30,7 @@ document.addEventListener("DOMContentLoaded", function () {
if (hash) {
// Find the tab with matching data-category
const tab = document.querySelector(
`.category-tab[data-category="${hash}"]`
`.category-tab[data-category="${hash}"]`,
);
if (tab) {
// Remove active class from all tabs and contents