never_rain Posted August 9, 2010 Share Posted August 9, 2010 I am working on a website where I have comments posted by users. I want to display 25 comments and if there are more, it will show a linke Older Posts similar to Facebook. Once I click on that, it will list down the next 25 comments and so on. This is something we can see in Facebook. Do you have any idea where I can find this script. I did search on google but couldn't find it. Probably bad keyword selection. any ideas for the resource. Thanks, Faisal Quote Link to comment Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 The idea is simple. Just LIMIT your first query to the top 25 results ordered by timestamp. Then, once a user clicks on 'more', execute another query to find the rest of the results. Quote Link to comment Share on other sites More sharing options...
never_rain Posted August 9, 2010 Author Share Posted August 9, 2010 Hi, thanks for the tip.. I am not sure how to do this as don't know too much of it. If you can do some code here.. that'll help Quote Link to comment Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 So, the link in your signature is what? Quote Link to comment Share on other sites More sharing options...
onlyican Posted August 9, 2010 Share Posted August 9, 2010 Do you mean a JavaScript script, where you click "more" and more comments just show up, expanding the box? Quote Link to comment Share on other sites More sharing options...
xangelo Posted August 9, 2010 Share Posted August 9, 2010 What you're essentially looking for is to couple thorpe's idea with onlyican. You'll need to run an asynchronous javascript request which would run the query and output the results as either xml or json. Your javascript can then deal with it as you want. I'd advise you to look at a javascript library such as jQuery, Dojo or MooTools. Their implementations of AJAX are cross browser. They also have tutorials on how to use them in their documentation. Quote Link to comment Share on other sites More sharing options...
Destructiva Posted November 10, 2010 Share Posted November 10, 2010 Hi there! I want to do the same principle of the Facebook's "Older Post Script", but I want to load pictures when click, can anyone point me to the code to do this? Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.