Browse Source

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

pull/4/head
s2 10 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 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/markdown-it/8.4.2/markdown-it.min.js"></script>
<script>
var md = window.markdownit();
fetch('README.md')
.then((r) => {
return r.text();
})
.then((r) => {
document.getElementById('md').innerHTML = md.render(r);
});

var xmlhttp;
xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function(){
if (xmlhttp.readyState == 4 && xmlhttp.status == 200){
document.getElementById('md').innerHTML = md.render(xmlhttp.responseText);
}
}
xmlhttp.open("GET", 'README.md', true);
xmlhttp.send();
</script>

</body>

Loading…
Cancel
Save