The code below is to read a text file using javascript. it works. However, I just want to read part of the content. For example, the content of the file is :\"Hello world!\
Try this to read separate words if I understood correctly what you need. Create a file with the contents "hello world" and browse to it with the example script. The output is "hello".
Reading directly has to be with an ajax request due to the javascript restrictions regarding safety. This code shoudl perform the requested operation: