Skip to content

Catching when "README.md" does not exist #4

Description

@TedThompson
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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions