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 7518741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:47:33+00:00 2026-05-30T01:47:33+00:00

So I have a load more button, and now I want to add a

  • 0

So I have a load more button, and now I want to add a loading more gif to it so a user realizes it is running for the 1-2 seconds it takes to get the data. This is my function:

<script type="text/javascript">
var pageNum = 2;
$(document).on('click', '#loadmore', function() {
     $.get('/loadmore.php?page=' + pageNum + '&aid=4', function(data) {
     $("#append").append(data);
        if(data){
            pageNum++; 
        }else{
            $('#loadmore').hide();  
        }
    });
});
</script>

How would i go about adding a gif that appears only while the data is being loaded?

  • 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-30T01:47:34+00:00Added an answer on May 30, 2026 at 1:47 am

    You can add your loader gif using HTML:

    <div class="loader"></div>
    

    CSS:

    .loader{background:url(spinner.gif) no-repeat;display:none}
    

    Add a reference in the beginning of your JS:

    var gif = $('.loader');
    

    Then work with it before & after the ajax function is completed:

    gif.show(); // show the spinner
    $.get('/loadmore.php?page=' + pageNum + '&aid=4', function(data) {
        gif.hide(); // hide it when the ajax request is completed
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a page with 5 pictures and a button to load more using
I have a tableview in which I have implemented Load More Records feature. But
In my website I have a file called learn-more.html , it's used to load
I have TableView and in this TableView I'm printing articles. Now user must click
I have this java code: <script src=http://www.google.com/jsapi></script> <script type=text/javascript> google.load(jquery, 1.2.6); $(a#more).click(function() { $(#info_box).show(blind,
At my day job we have load balanced web servers which talk to load
I have a load of apps written to target 1.6 (old school) Is there
I have to load huge (3000x3000) pictures in SWFLoader, and no problems with that
I have a load of php templates which uses a custom translate function __,
i have tried load and hebrew didn't work for me so i changed my

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.