Initial commit
This commit is contained in:
12
lib/images/load_html.js
Normal file
12
lib/images/load_html.js
Normal file
@@ -0,0 +1,12 @@
|
||||
document.querySelectorAll('.url_insert').forEach(url_insert);
|
||||
function url_insert(el) {
|
||||
var url = el.dataset.url;
|
||||
var xhttp = new XMLHttpRequest();
|
||||
xhttp.onreadystatechange = function() {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
el.innerHTML = this.response;
|
||||
}
|
||||
};
|
||||
xhttp.open("GET", url, true);
|
||||
xhttp.send();
|
||||
}
|
Reference in New Issue
Block a user