I have a script which gets a value from a .txt file, I have done it with a number value where it works perfectly, but when I want to do it with another .txt file, which is a text and not a number I get the "NaN" error which I know stands for "not a number", but then how do I change it to work so that I can get the value text in the .txt file?
Display name: <span id="displayNameDisplay"></span>
var read = new XMLHttpRequest();
read.open('GET', 'displayNameFile.txt', false);
var displayName = parseInt(read.responseText)
document.getElementById("displayNameDisplay").innerHTML = displayName;
If you don't want to convert the text to an integer, simply don't run
parseInt over it.