var xhr = new XMLHttpRequest();
xhr.onloadedend = function () {
if(xhr.status == 404) return;
}
xhr.onreadystatechange = function () {
First and last lines already exist - I inserted this function. I am using your "index.html" renamed as the src for an IFRAME in my index.html. It's a header for the index in every folder on my site, and will display the Readme.md as a MOTD - but I needed to avoid a 404 error if there was no Readme.md.
I also added
<script>
var path = document.referrer;
var motd = "Readme.md";
var file = path.concat(motd);
</script>
to your original HTML, so it looks for the Readme.md in the same directory as the parent page.
First and last lines already exist - I inserted this function. I am using your "index.html" renamed as the src for an IFRAME in my index.html. It's a header for the index in every folder on my site, and will display the Readme.md as a MOTD - but I needed to avoid a 404 error if there was no Readme.md.
I also added
to your original HTML, so it looks for the Readme.md in the same directory as the parent page.