How do I read a local text file in JavaScript, w/o jquery etc.? I realize the question has been asked before, with a gazillion answers (but both html and javascript also have changed a lot over the years).
So here is my scenario:
- do not want to use any webserver for this purpose as I wish to send a tarball+make install to someone for a demo and want zero installation
- a blocking read is fine
- files are simple text files such as "downloaded/xyz.json". They are indeed stringify'd json. Do not want to use a files dialog box to select file name - hardcoding is the desirable for this purpose
- Security is not an issue in this context, although I am not prepared to run the browser with --disable-web-security or do anything that's even remotely cross-domain
- env: linux (openSuse 11.4), using google-chrome
- do not want to use jquery for this
Will greatly appreciate a simple code snippet, if it is feasible.