-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
38 lines (37 loc) · 920 Bytes
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<!DOCTYPE html>
<html>
<head>
<script>
function embedHTML() {
var me = document.getElementsByTagName("*");
for (var i = 0; i < me.length; i++) {
var elem = me[i];
var file = elem.getAttribute("w3-include-html");
if (file) {
elem.innerHTML = file;
httpReq = new XMLHttpRequest();
httpReq.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) { elem.innerHTML = this.responseText; }
if (this.status == 404) { elem.innerHTML = "Page not found."; }
elem.removeAttribute("w3-include-html");
embedHTML();
}
}
elem.innerHTML = file; // me[5].tagName;
httpReq.open("GET", file, true);
httpReq.send();
return;
}
}
}
</script>
</head>
<body>
<div w3-include-html="file://README.md">??????</div>
<h1>Hello</h1>
<script>
embedHTML();
</script>
</body>
</html>