Currently I am just seeing if I can get anything from the text file to show up on my website so I can work with it. I've checked multiple questions on here, but I feel like my lack of knowledge with web development is showing here.
So my javascript function is this...
function readTextFile(file)
{
var rawFile = new XMLHttpRequest();
rawFile.open("GET", file, false);
rawFile.onreadystatechange = function ()
{
if(rawFile.readyState === 4)
{
if(rawFile.status === 200 || rawFile.status == 0)
{
var allText = rawFile.responseText;
document.write(allText);
}
}
}
rawFile.send(null);
}
So ideally I would think that this would just write the text onto the page. So I call it within the page like this...(I'm not terribly creative just thought this should work).
<body onload="readTextFile('info.txt')">
What am I missing ?