Browse Source

don't use `fetch`, so google maybe can render the page

master
s2 5 months ago
parent
commit
7c3b7675fa
1 changed files with 10 additions and 7 deletions
  1. 10
    7
      index.html

+ 10
- 7
index.html View File

@@ -64,13 +64,16 @@
64 64
 		<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/8.4.2/markdown-it.min.js"></script>
65 65
 		<script>
66 66
 			var md = window.markdownit();
67
-			fetch('README.md')
68
-			.then((r) => {
69
-				return r.text();
70
-			})
71
-			.then((r) => {
72
-				document.getElementById('md').innerHTML = md.render(r);
73
-			});
67
+
68
+			var xmlhttp;
69
+			xmlhttp = new XMLHttpRequest();
70
+			xmlhttp.onreadystatechange = function(){
71
+				if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
72
+					document.getElementById('md').innerHTML = md.render(xmlhttp.responseText);
73
+				}
74
+			}
75
+			xmlhttp.open("GET", 'README.md', true);
76
+			xmlhttp.send();
74 77
 		</script>
75 78
 
76 79
 	</body>

Loading…
Cancel
Save