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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T01:35:40+00:00 2026-05-14T01:35:40+00:00

I want to create a section in my site, where a user has a

  • 0

I want to create a section in my site, where a user has a few simple update buttons.

Each of these update buttons will be going to the server, and will do a long crunching behind the scene.

While the server crunches data, I want the user to have a some kind of progress indicator, like progress bar or textual percentage.

I’m using jQuery as my JavaScript library, and CodeIgniter (PHP) as the server-side framework, if it’s important…

What I was thinking about is using PHP’s flush() function to report progress status to jQuery, but I’m not sure that jQuery’s Ajax functions are reading the output before it’s complete…

So any advice/explanation would be useful and helpful!

  • 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-14T01:35:41+00:00Added an answer on May 14, 2026 at 1:35 am

    I’m going to give you an example using WebSync On-Demand, but the same approach would work regardless of your choice of server.

    Here’s what you do. First, kick off the long-running operation somehow; your user clicks the button to start this process (I’m going to assume an Ajax call, but whatever works), and you return to them some sort of identifier, we’ll call that ‘myId’, give it a value of ‘1’. Whether you do that by invoking a process of some sort, etc, is up to you.

    Then, in your callback from that invocation, you would write something like so:

    var myId = 1; // this would be set somewhere else
    client.initialize('api key');
    client.connect();
    client.subscribe({
      channel: '/tasks/' + myId,
      onReceive: function(args){
        // update the progress bar
        myProgressBar.update(args.data.progress);
      }
    });
    

    What that’ll do is subscribe your client to receive notification about updates to the task, so all that’s left is to push out the updates, which you’d do in whatever process is actually running the task. That would look like (in PHP, using the SDK):

    $publisher = new Publisher(
        "11111111-1111-1111-1111-111111111111", // your api key again
        "mydomain.com" // your domain
    );
    
    // publish data
    $response = $publisher->publish(array(
        array(
            'channel' => '/tasks/' . $myId, //comes from somewhere
            'data' => (object) array(
                'progress' => '45' //45% complete
            )
        )
    ));
    
    // success if empty (no error)
    $success = empty($response); 
    

    That’s it; as updates occur, they’ll push out to your client in real-time.

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

Sidebar

Related Questions

I've built a simple cms with an admin section. I want to create something
I want to create a simple http proxy server that does some very basic
I have an ASP.NET 3.5 e-commerce site that has an admin section. I want
I want to create section without numbers using the command \section*{Section Name}, but doing
I want to create a simple PHP website containing quite a number of pages.
I want to create a flash site where I have a long horizontal movie
I have a few links on my site that will need to show a
I want to create a site with a background one color and the centered
In Drupal 7 I want to have a site that has distinct sections with
I'm trying to make a comment section for my site. After a comment has

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.