footer: add footer loader
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user