From e08185acebf254c955e49332923f6b53b5cef5ad Mon Sep 17 00:00:00 2001 From: Ruthenic Date: Sun, 2 Jan 2022 15:01:25 -0500 Subject: [PATCH] fix footer --- footer.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/footer.js b/footer.js index 4d437f3..a779218 100644 --- a/footer.js +++ b/footer.js @@ -1,11 +1,15 @@ -async function getFooter(footerPath) { +function getFooter(footerPath) { if (footerPath === undefined) { - //why the hell does js not have optional parameters for functions? - footerPath = "/footer.html"; + footerPath = "/footer.html" } - console.log("sanity check much?"); - console.log(footerPath) - footer = await fetch(footerPath); - footer = await footer.text(); - document.getElementById("footer").innerHTML = footer; + //footer = await fetch(footerPath); + //footer = await footer.text(); + // I have to use XMLHttpRequest for some godforsaken reason (to support IE) + var req = new XMLHttpRequest() + var onload = function() { + document.getElementById("footer").innerHTML = this.responseText; + } + req.addEventListener("load", onload) + req.open("GET", window.location.origin + footerPath) + req.send() }