First version.

This commit is contained in:
sarah committed 2026-08-19 18:04:05 +02:00
1 parent bcf3a3b4ef
commit e083ead16b
8 files changed
+292

No files matched your search

+26
View File
@@ -0,0 +1,26 @@
function includeHTML() {
var z, i, elmnt, file, xhttp;
console.log("Including HTML.")
z = document.getElementsByTagName("*");
for (i = 0; i < z.length; i++) {
elmnt = z[i];
file = elmnt.getAttribute("include");
if (file) {
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {elmnt.innerHTML = this.responseText;}
if (this.status == 404) {elmnt.innerHTML = "Page not found.";}
elmnt.removeAttribute("include");
includeHTML();
}
}
xhttp.open("GET", file, true);
xhttp.send();
return;
}
}
}