mirror of
https://git.srhtnin.garden/sarah/srhtnin.github.io.git
synced 2026-10-14 02:38:12 +02:00
Converted to PHP.
This commit is contained in:
1 parent
e083ead16b
commit
eb6d31fb2f
5 files changed
+12
-31
No files matched your search
@@ -1,26 +0,0 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user