I am getting a user’s posts with the Facebook API like so:
FB.api('/me/home', function (response) {
});
This returns a paging object, with two values: previous and next.
Later in my app, I want to have a button to ‘load more’ for pagination. So I need to use these values to load the next lot of data from the API.
My question is how I am supposed to load this data? previous and next are full length URLs which do not work with the JavaScript Graph API (FB.api('...')). How exactly am I supposed to use the URL it provides me with? Or is there a better way to do pagination?
You should do server-side requests to ‘previous’ and ‘next’ and send the results to a client on clicking your pagination links/buttons.
EDIT
Or just shorten these urls. Make them relative instead of absolute