Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

APIs

ABHINAV VERMA
ABHINAV VERMA
6,033 Points

Lazy loading from the server

I wanted to know how does the load on scroll method of facebook and twitter work. how do they keep fetching data and is the process stateless. What needs to be done at the server level and at the client level.

2 Answers

Steven Parker
Steven Parker
231,271 Points

I don't know the specifics of those services, but most likely what you describe is implemented using AJAX, which allows additional server requests to be made without a complete page refresh. There's an AJAX Basics course available if you're interesting in learning how to use this technology.

ABHINAV VERMA
ABHINAV VERMA
6,033 Points

I am aware of the basics of AJAX. in the AJAX basics course towards the end the teacher suggests creating a search in which the old photos are not fetched and instead new photos are fetched. That's what I want to do . e.g if I've fetched few rows from a database , I don't want the new ajax request to fetch the same rows. I'm confused as to how to achieve in a stateless request.

Steven Parker
Steven Parker
231,271 Points

The request may be "stateless", but it can still convey specific values in a query string or POST data.