fix footer
parent
b7f58bf51d
commit
e08185aceb
@ -1,11 +1,15 @@
|
|||||||
async function getFooter(footerPath) {
|
function getFooter(footerPath) {
|
||||||
if (footerPath === undefined) {
|
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?");
|
//footer = await fetch(footerPath);
|
||||||
console.log(footerPath)
|
//footer = await footer.text();
|
||||||
footer = await fetch(footerPath);
|
// I have to use XMLHttpRequest for some godforsaken reason (to support IE)
|
||||||
footer = await footer.text();
|
var req = new XMLHttpRequest()
|
||||||
document.getElementById("footer").innerHTML = footer;
|
var onload = function() {
|
||||||
|
document.getElementById("footer").innerHTML = this.responseText;
|
||||||
|
}
|
||||||
|
req.addEventListener("load", onload)
|
||||||
|
req.open("GET", window.location.origin + footerPath)
|
||||||
|
req.send()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue