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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:36:20+00:00 2026-06-15T23:36:20+00:00

i have this jquery code, ajax, whch helps me to do some pagination. Now,

  • 0

i have this jquery code, ajax, whch helps me to do some pagination.

Now, i grab the data from a php file which has only some information printed.

The index file is this one:

<script type="text/javascript">
    $(document).ready(function(){
        function loading_show(){
            $('#loading').html("<img src='images/loading.gif'/>").fadeIn('fast');
        }
        function loading_hide(){
            $('#loading').fadeOut('fast');
        }                
        function loadData(page){
            loading_show();                    
            $.ajax
            ({
                type: "POST",
                url: "load_data.php",
                data: "page="+page,
                success: function(msg)
                {
                    $("#container").ajaxComplete(function(event, request, settings)
                    {
                        loading_hide();
                        $("#container").html(msg);
                    });
                }
            });
        }
        loadData(1);  // For first time page load default results
        $('#container .pagination li.active').live('click',function(){
            var page = $(this).attr('p');
            loadData(page);

        });           

        });
    });
</script>

What i want to do is that, i want to reload the page only if i am on the first page, i mean, in pagination we have something like:

<- 1 2 3 4 5 6 7 ->

I want to reload the content without refreshing only if i’m on the first page.
Can someone help me with that?
Thanks!

  • 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-06-15T23:36:20+00:00Added an answer on June 15, 2026 at 11:36 pm
    $('#container .pagination li.active').live('click',function(){
         var page = $(this).attr('p');
    
         if(page === 1){
             setTimeout(function(){
                 loadData(page);
         }, 2000);
    
        }
    });  
    

    Here’s a similar solution to the one already posted, but executed after 2 seconds. Change the second arg (milliseconds) to any value you want.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this jquery code: $.ajax({ url:'ajax/windowshop.php', context:'#windowShop', success:function(data){ $('#windowShop').append(data); } }) I want
I have this jquery code: var myarr = [aa,ss,dd]; $.ajax({ url: proces.php, data: arr=+myarr,
I have this jQuery code: $.ajax({ type: POST, url: /problems/vote.php, dataType: json, data: dataString,
I have this jQuery code: $(document).ready(function() { $.ajax({ url: pages/+page+.php, cache: false }).done(function( html
I have this jQuery ajax: // ... omitted code ... var data = {'TagName':'
Hi i have this code right now on my website... <script src=http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js type=text/javascript charset=utf-8></script>
I have this jquery code: $.ajax({ type: GET, url: http://api.ipinfodb.com/v2/ip_query.php?key=3b80b5588c22d2a03c0e6979d1e85e397e043646c4a65ffe47ff01d47bce51e, dataType: xml, success: function(xml)
I have this jquery.ajax form which populates data from the database and auto fills
On my main page I have this jquery code which does an ajax call
I have this Javascript/JQuery code: <script type=text/javascript src=http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js></script> <script type=text/javascript> name = $(#name).val(); alert(Name:

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.