title: Datatables - How do I create a listener for when scroll is near the bottom of the table?
body: <p>I am currently using datatablesJS(from <a href="https://datatables.net/" rel="nofollow noreferrer">https://datatables.net/</a>) to show an array of results from a DB that is paginated. So on initial load the user gets index 0 and 100 rows. </p>
  
  <p>I'm trying to write a function so that when the user scrolls close to the bottom of the table, it'll query for more of the table and append the results to the current data array. I have the query setup, but I don't know of a jquery or datatablesJS function that listens for how far the scroll is to the bottom of its max scroll length. Any suggestions? </p>
  
  <p>Note: This question seems similar to <a href="https://stackoverflow.com/questions/31410425/on-datatable-scroll-data-should-load-from-server-side-and-append-to-existing-rec">On dataTable scroll data should load from server side and append to existing records</a>, but the difference is that I only want to query when the user scrolls to the bottom. This post and from what I see on DataTables doc is that they run a Timeout till they get all the data with the ajax param for Datatables. </p>