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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:30:03+00:00 2026-05-13T05:30:03+00:00

I was wondering if it would be possible to use jQuery’s ajax function to

  • 0

I was wondering if it would be possible to use jQuery’s ajax function to continually return a result to a page and update accordingly.

What I mean is this:
– User fires off a search
– jQuery uses ajax function to get the first 25 results and adds them to a table.
– While the user is looking at that list, jQuery keeps grabbing results 25 at a time and adding them to the table.

The idea behind this is, say your users search has 10,000 results. I would like to load them into a table that has paging controlled by Javascript so that we don’t have to go back to the server each time the user wants to go to the next page.
The time it takes a user to look at the first 25 results, we could probably have the next 50 loaded, which means we will have a very snappy looking interface with all the results.

Now there are definitely some downsides to this:
– the user can’t immediately go to “Last”
– the user can’t sort the table right away (or if they do they might immediately have a table that is not sorted correctly)

Still, I think this is an interesting idea and would love to try it out…but I have no idea where to begin.

How do you make the ajax function continue to run until a certain result happens? Can you add the results to a Table and have that table be continually changed without giving the user a bad interface experience?

  • 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-13T05:30:03+00:00Added an answer on May 13, 2026 at 5:30 am

    JQuery provides callbacks for $.post, $.get and $.ajax. So, you can write a function to handle the input and keep feeding the function as the callback until the result sets are finished loading.

    If the user does try the sort the table or jump down the results list, the table would need to reset and the next callback would need to detect the sort/paging change and send those variables to the server.

    Something like this:

    var page_number= 1;
    var sort_by= 'column_name';
    var sort_direction= 'asc';
    
    function handle_result(data) {
      // Do something with the result/return data from the POST
      ....
      // $.post again . . . when there are more rows
      if (data.has_more_rows) {
        page_number++;
        $.post('process.php', { page_number: page_number, sort_by: sort_by, sort_direction: sort_direction }, handle_result);
      }
    }
    
    // The initial post . . .
    $.post('process.php', { page_number: page_number, sort_by: sort_by, sort_direction: sort_direction }, handle_result);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.