최초 커밋
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
// include.js
|
||||
window.addEventListener('load', function() {
|
||||
var allElements = document.getElementsByTagName('*');
|
||||
Array.prototype.forEach.call(allElements, function(el) {
|
||||
var includePath = el.dataset.includePath;
|
||||
if (includePath) {
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function () {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
el.outerHTML = this.responseText;
|
||||
}
|
||||
};
|
||||
xhttp.open('GET', includePath, true);
|
||||
xhttp.send();
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user