<p>I am displaying a scrolled data table in a web page.  This table has several thousands of dynamic rows, so it is loaded from the server (via AJAX).</p>

<p>The user can scroll up and down, so what I need is to <strong>detect when the user reaches the end of the scrollbar</strong> (that is, the last row at the bottom of the table) in order to request and show more data.</p>

<p>You can find this effect in google reader, when you scroll down to the last post in a given feed, google requests and shows new posts in a transparent way, but I can't figure out how they achieve it.</p>

<p>By the way, right now I am using a <a href="http://developer.yahoo.com/yui/datatable/" rel="noreferrer">YUI Datatable</a></p>

I'm not familiar with the specific element you are using, but in order 
 to implement this on a full size window, you can do the following:
```
```
$wnd.onscroll = function() {
    if (($wnd.height - $wnd.scrollTop) < SOME_MARGIN) then doSomething();
};
```
```
Where scrollTop is essentially "how many pixels have been scrolled".
I assume applying this to the table you are working with will do the job.