I would like to know if there is some way to read a .txt file from Javascript in real-time?
I have a log file that updates every few seconds. I want to parse some data from that log file as it updates and display it in a html.
Can I do this live?
Thanks a lot guys!
I would like to know if there is some way to read a .txt
Share
Assuming the file is somewhere publicly accessible, you can have a javascript function which makes an AJAX request every few seconds to read the file. Something like the following: