I haven\'t used JavaScript in a while and I can\'t seem to read a text file and display the contents.
I\'ve tried onload as well as onloadend
onload
onloadend
you can use ajax to get the content of your file:
var reader= new XMLHttpRequest(); reader.open('GET', '/pi.txt'); reader.onreadystatechange =readSuccess(); function readSuccess(evt) { var field = document.getElementById('main'); field.innerHTML = reader.responseText; }; reader.send();