2

I've been reading and trying to implement various forms of infinite scroll, whether it be in jquery, django, or some combo of both. I'm using the firebug extension in chrome to track the calls made when I scroll to the bottom of the page and request more data from my database. Whenever I hit the bottom of the page, firebug shows an additional request to grab more data.

Using firebug on twitter.com and facebook.com, I noticed that no additional requests show up in firebug when I use their infinite scrolls and scroll to the bottom of the page, even though more data is loaded. I imagine this is much better from a security standpoint. How do they do "hide" those additional requests?

Robin Maben
  • 22,194
  • 16
  • 64
  • 99

3 Answers3

2

They don't hide it. They do fetch the extra data on an on-demand basis


Possible approaches you could look into are :-

  1. Tracking the scroll event to see if user has reached the end of scroll.
  2. Track when the footer(or similar div at the bottom) comes into view.
Community
  • 1
  • 1
Robin Maben
  • 22,194
  • 16
  • 64
  • 99
  • @kristen: I agree. But answering your question with just a yes/no does not make my answer helpful for future visitors reading the answers here. Which is why I added some useful pointers with links. – Robin Maben Sep 02 '12 at 19:53
2

It makes sense to split the results in different requests in these cases, because you will render faster, since you do not preload all the results but only a part of them.

In your case, if the amount of data is not that much but you just want to handle they way you present them, you can split your results in blocks of a fixed number. You can add an extra block of results till they run out every time you scroll down.

topless
  • 8,069
  • 11
  • 57
  • 86
1

The extra content isn't hidden - in Facebook, when you approach the end of the page an ajax call is made to get the new content.

Looking at the resources in Chrome a call is made to this file to load the extra contents -

https://www.facebook.com/ajax/pagelet/generic.php/MoreStoriesPagelet

Robin Maben
  • 22,194
  • 16
  • 64
  • 99
DaveR
  • 2,355
  • 1
  • 19
  • 36