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

  • Home
  • SEARCH
  • 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

Related Questions

EDIT: This question is more about language engineering than C++ itself. I used C++
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT : This question duplicates How to access the current Subversion build number? (Thanks
(EDIT: This question is now outdated for my particular issue, as Google Code supports
I'm using markdown to edit this question right now. In some wikis I used
[EDIT] Hmm. Perhaps this question should be titled what is the default user-input dialog
EDIT: This was formerly more explicitly titled: - Best solution to stop Kontiki's KHOST.EXE
EDIT: had to retag this, because, it's rather a Sweave / R question since
Edit: This was accidentally posted twice. Original: VB.NET Importing Classes I've seen some code
Edit: This code is fine. I found a logic bug somewhere that doesn't exist

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.