Here is a proprietary JavaScript solution without libraries.
http://caniuse.com/xhr2
As asynchronously, you need to create 2 functions
one to read and another to show / change or something else
function read(textFile){ var xhr=new XMLHttpRequest; xhr.open('GET',textFile); xhr.onload=show; xhr.send() } function show(){ var pre=document.createElement('pre'); pre.textContent=this.response; document.body.appendChild(pre) } read('text.txt');
If you work a lot with external files, I suggest also take a look at the new javascript classes new FileReader() and window.requestFileSystem()
where new FileReader() now has a bit more support, also on mobile devices
and from what I know window.requestFileSystem() is almost not supported .. but you can handle files that are large gb large .. using Chrome.
cocco source share