Jump to content

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...

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.