[Help] Read a external txt file in a html file
Hey,
I want to read a .txt file in the index.html. The index should read the State.txt and put the text inside this file in a text. I found some things on google:
Code:
<script type="text/**********">
File1 = document.open("State.txt");
File2 = document.open("Mod.txt");
file_length1 = flength(file1);
content1 = fread(file1, file_length1);
file_length2 = flength(file2);
content2 = fread(file2, file_length2);
In1 = document.getElementById("Stat");
In2 = document.getElementById("Mod");
In1.innerText = content1;
In2.innerText = content2;
</script>
I tryed this but it didn't work

And the State.txt is in the same directory as the index.html on the webserver.
Is there any way to do this? Or make the above working?