Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 669963
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:12:37+00:00 2026-05-14T00:12:37+00:00

EDIT: This question was initially too general, I think. So What I really need

  • 0

EDIT: This question was initially too general, I think. So What I really need is a very good tutorial on how to implement the Load More function on Safari for iPhone just like the Twitter website(mobile.twitter.com) does. Just a wordpress plugin won’t really help. But if the plugin is well explained, like if it is wptouch, home(that also has this function) that can also do.

I know that it doesn’t really matter that it is being displayed on a mobile device, but the point I am stressing is that if such a function is well explained, then it will be up to me to know how to customize it to suit me.

I am using a javascript function to load entries that come from the database dynamically, so that content opens in the same page (like with twitter(tweets feed) and facebook(news feed)).

The php/html version(That opens a page in a new tab) is

echo '<a href="http://'. $_SERVER['HTTP_HOST'] .'/'.$domain_page.'?form='.$form_id.'&page='.($page+1).'">Load more entries&rsaquo; </a>';

The javascript/ajax version:

<div id="call_hv<?php echo md5($_SERVER['REQUEST_URI']); ?>" class="ajax-load-more">

                <img id="spinner<?php echo md5($_SERVER['REQUEST_URI']); ?>" class="spin" src="<?php bloginfo('template_directory'); ?>/images/main-ajax-loader.gif" style="display:none" alt="" /> 

                <a class="ajax" href="javascript:$ajax_hv('#spinner<?php echo md5($_SERVER['REQUEST_URI']); ?>').fadeIn(200); 

                $ajax_hv('#ajaxentries_hv<?php echo md5($_SERVER['REQUEST_URI']); ?>').load('form='<? echo $form_id; ?>&page=<?php echo $page+1;?>', {}, 

                function(){ $ajax_hv('#call_hv<?php echo md5($_SERVER['REQUEST_URI']); ?>').fadeOut();})">Load more entries... 

                </a>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:12:37+00:00Added an answer on May 14, 2026 at 12:12 am

    The basic idea is to listen to scroll events, and implement paging on the server side.

    A scroll event is fired whenever the document or a contained HTML element scrolls. I’ll use this sketch for reference keeping the following things in mind:

    Let’s say the height of the browser window is 800px, and the initial height of the content is 2500px. The threshold for loading AJAX content is when the user scrolls to the bottom 100px of our content (after the first 2400px).

    alt text

    We will need to keep track of the following 2 items:

    1. Items/Pages loaded so far.
    2. How far are we from the bottom of
      the page.

    The code references are in MooTools, but the concept is the same. Converting it to jQuery is a trivial task once you understand it.

    var maxPage = 1;
    var threshold = 100;
    

    We need to know whenever the page scrolls, so add a handler for scroll events. Find the scroll distance to the bottom of the page. If it’s less than the defined threshold (100px), then fire off an AJAX request loading the next page. When the response comes (if successful), append it to the page and increment maxPage number.

    Another thing to keep in mind is to only fire an AJAX request if content is not already being loaded. Have a flag that indicates whether the page request is still pending.

    var isLoading = false;

    window.addEvent('scroll', function() {
        // the height of the entire content (including overflow)
        var contentHeight = window.getScrollSize().y;
        // current scroll is height of content that's above the viewport plus
        // height of the viewport.
        var contentScrolled = window.getScroll().y + window.getSize().y;
        var distanceToBottom = contentHeight - contentScrolled;
        var closeToBottomOfPage = distanceToBottom < threshold;
        var shouldLoadMoreContent = !isLoading && closeToBottomOfPage;
    
        if(shouldLoadMoreContent) {
            // create an ajax request
            var request = new Request({
                url: 'http://www.example.com/more',
                onSuccess: function(responseText) {
                    $('page').append(responseText);
                    maxPage++;
                },
                onRequest: function() {
                    isLoading = true;
                },
                onComplete: function() {
                    isLoading = false;
                }
            });
            // fire off ajax request with the page # as a querystring param
            request.send({page: maxPage});
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 394k
  • Answers 394k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer but no other staticdir declarations because CP should be looking… May 15, 2026 at 2:18 am
  • Editorial Team
    Editorial Team added an answer You can view your nib file objects in a tree… May 15, 2026 at 2:18 am
  • Editorial Team
    Editorial Team added an answer A slightly faster approach than looping on xrange(N) is: import… May 15, 2026 at 2:18 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.