This commit is contained in:
Kyle
2020-12-16 15:30:48 -08:00
parent 2b931a1fdf
commit 1a9d15d94b
596 changed files with 4053 additions and 1205 deletions

24
js/includeHTML.js Normal file
View File

@@ -0,0 +1,24 @@
function includeHTML() {
var elementList = document.getElementsByTagName('*');
for (var i = 0; i < elementList.length; i ++) {
element = elementList[i];
var file = element.getAttribute('html-include');
if (file) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {
element.innerHTML = this.responseText;
} else if (this.status == 404) {
element.innerHTML = 'HTML inclusion not found';
}
element.removeAttribute('html-include');
includeHTML();
}
}
xhttp.open('GET', file, true);
xhttp.send();
return;
}
}
}