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.
19 lines
516 B
JavaScript
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");
|
|
}); |