Jump to content

How does Facebook do this...?


markvaughn2006

Recommended Posts

If this is the wrong section sorry, I'm thinking this some kind of ajax call. On Facebook, if you scroll all the way down and click "Older Posts" and it looks like it is loading and then drops down with older posts. Could someone please point me in the right direction of how this might be done?? Thanks sooo much!

Link to comment
https://forums.phpfreaks.com/topic/224026-how-does-facebook-do-this/
Share on other sites

We know that:

  All posts are in a DB somewhere.

 

So lets say:

    we have n posts displayed. And there are m posts in total m>n

 

So we:(in theory)

    Make an ajax request to a PHP script that gets x posts from the DB. The PHP script then returns the posts.

    insert into array.

    foreach(item in array){display html + post}

    ???

    Profit!!

 

Feel free to replace m, n , x with whatever numbers you want.

and PHP with python, .NET , ASP , Java , C etc...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.