I need to detect when a user arrives at the end of a readonly textarea in an html page.
The textarea will display a very long log for an application. The logs files are so big that is impossible to load all the text in one time (some log files are almost 200 MB). So I will load the first, say, 1000 lines, and then I need to detect when the user is near the last line of the loaded text to give him the next n lines via an ajax call.
What is the best way to detect this event?