Add files via upload

main
PJ568 2 years ago committed by GitHub
parent bc4d9c0a30
commit acf54ae5e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,19 @@
function includeHTML() {
var elements = document.getElementsByTagName("include");
for (var i = 0; i < elements.length; i++) {
var element = elements[i];
var file = element.getAttribute("src");
if (file) {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState === 4 && this.status === 200) {
element.innerHTML = this.responseText;
}
};
xhttp.open("GET", file, true);
xhttp.send();
}
}
}
document.addEventListener("DOMContentLoaded", includeHTML);
Loading…
Cancel
Save