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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:38:30+00:00 2026-05-18T20:38:30+00:00

I have a page which uses jquery’s ajax functions to send some messages. There

  • 0

I have a page which uses jquery’s ajax functions to send some messages.

There could be upwards of 50k messages to send.

This can take some time obviously.

What I am looking to do is show a progress bar with the messages being sent.

The backend is PHP.

How can I do this?


My solution:
Send through a unique identifier in the original ajax call.
This identifier is stored in a database(or a file named with the identifier etc), along with the completion percentage.

This is updated as the original script proceeds.

a function is setup called progress(ident)

The function makes an ajax call to a script that reads the percentage.
the progressbar is updated
If the returned percentage is not 100,
the function sets a timeout that calls itself after 1 second.

  • 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-18T20:38:31+00:00Added an answer on May 18, 2026 at 8:38 pm

    You could have an animated gif load via .html() into the results area until your ajax function returns back the results. Just an idea.

    Regarding the jquery ui progress bar, intermittently through your script you’ll want to echo a numeric value representing the percent complete as an assigned javascript variable. For example…

    // text example php script
    if (isset($_GET['twentyfive-percent'])) {
        sleep(2); // I used sleep() to simulate processing
        echo '$("#progressbar").progressbar({ value: 25 });';
        }
    if (isset($_GET['fifty-percent'])) {
        sleep(2);
        echo '$("#progressbar").progressbar({ value: 50 });';
        }
    if (isset($_GET['seventyfive-percent'])) {
        sleep(2);
        echo '$("#progressbar").progressbar({ value: 75 });';
        }
    if (isset($_GET['onehundred-percent'])) {
        sleep(2);
        echo '$("#progressbar").progressbar({ value: 100 });';
        }
    

    And below is the function I used to get the progress bar to update its position. A little nuts, I know.

    avail_elem = 0;
    function progress_bar() {
        progress_status = $('#progressbar').progressbar('value');
        progress_status_avail = ['twentyfive-percent', 'fifty-percent', 'seventyfive-percent', 'onehundred-percent'];
        if (progress_status != '100') {
            $.ajax({
                url: 'test.php?' + progress_status_avail[avail_elem],
                success: function(msg) {
                    eval(msg);
                    avail_elem++;
                    progress_bar();
                    }
                });
            }
        }
    

    If I had to guess, I bet there is a better way… But this is the way it worked for me when I tested it.

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

Sidebar

Related Questions

I have a page which uses jquery's ajax functions to send some messages. There
I have a page which uses jQuery for some AJAX-stuff und Django as main
I have a web page which uses in PHP and a jQuery DataTable to
Scenario: I have a login page which uses ajax to validate a user and
I am new to jQuery / AJAX. I have a page that uses colorbox
I have a page that uses jQuery's $.post() method to get some html and
I have a page which uses javascript to add some textboxes to the page,
I have an application which uses an open JQuery Ajax connection to do long-polling/comet
I have a page which uses a fair bit of ajax to load its
In my master page, on the menu there is an icon which uses Jquery

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.