blog/theme/navbar.js

9 lines
384 B
JavaScript

document.addEventListener('DOMContentLoaded', function () {
fetch('/includes/navbar.html')
.then(function (res) { return res.text(); })
.then(function (html) {
var wrapper = document.createElement('div');
wrapper.innerHTML = html.trim();
document.body.insertBefore(wrapper.firstChild, document.body.firstChild);
});
});