shiloh-echo/js/main.js
Tony M 9de5c64704 Drop jQuery, rewrite JS in vanilla, defer scripts
Remove jquery-3.7.1.min.js (162 KB) and countdown.js plugin.
Rewrite main.js, back-to-top.js, agenda.js in vanilla JS.
Replace jQuery countdown init with inline vanilla countdown.
2026-07-04 11:33:25 -07:00

19 lines
516 B
JavaScript

function loadInto(id, url) {
var el = document.getElementById(id);
if (!el) return;
fetch(url)
.then(function (res) {
if (!res.ok) throw new Error(res.status);
return res.text();
})
.then(function (html) {
el.innerHTML = html;
})
.catch(function () {});
}
document.addEventListener("DOMContentLoaded", function () {
loadInto("header", "./components/header.html");
loadInto("footer", "./components/footer.html");
loadInto("message", "./components/message.html");
});