blog/theme/navbar.js

10 lines
384 B
JavaScript
Raw Normal View History

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);
});
});