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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T17:00:33+00:00 2026-05-25T17:00:33+00:00

I have a jQuery ui progressbar var item = 4; $(‘<div/>’, { id: ‘progressBar’

  • 0

I have a jQuery ui progressbar

var item = 4;

$('<div/>', { id: 'progressBar' + item, 'class': 'ui-widget-default flpb' }).appendTo($('#test'));
$('#progressBar' + item).progressbar({ value: 0 });

here the progressbar shows up on the page

then I do a ajax call like this

$.getJSON("http://" + jsonServiceUrl + "/data/for/" + item + "/from/" + $('#dtStart').val() + "/to/" + $('#dtEnd').val() + "?callback=?", 
   function (results) {
       var pbScale = 100 / results.count,
           startTime = new Date().getTime();

       $.each(result, function (r, result) {
           //here the progress bar doesn't update.
           $('<div/>', { html: " Date: " + new Date(parseInt(result.TimeOfMeasurement.substr(6))) }).appendTo('#test');
           $('#progressBar' + item).progressbar('value', r * pbScale);
       });
       console.debug('elapsed milisecs: ' + new Date().getTime() - startTime;
   });

The progressbar gets updates to “100%” after the callback function finishes.

EDIT:

I’m not trying to get the progress of my json call, I’m trying to get the progress of looping through the collection of things I get back from the server. Next to updating the progress bar I also draw a div for every item in the collection. There are upto 200 items in the collection so there is progress enough to be shown.

Next to the progress bar not updating, the newly generated divs also don’t show up until the callback function finishes.

I added the timer and the processing time is about 1000 miliseconds (which must be enough to update the progressbar a couple items).

  • 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-25T17:00:33+00:00Added an answer on May 25, 2026 at 5:00 pm

    $.each is a synchronous call, which is equivalent to a for(;;;) loop. The iteration over your results is instantaneous, and whilst the progressbar will be updating in the background, it’s too quick for you to notice.

    You want to be showing the progress of your AJAX request, not your progress of iterating over the result set. Furthermore, because the $.each is synchronous, if it ever becomes large enough to warrant a progressbar for it, you’ll have bigger problems to worry about; such as the unresponsiveness of your application until the iteration completes, than showing a progress bar.

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

Sidebar

Related Questions

I have a jquery ui loading bar: $(document).ready(function() { $(#progressbar).progressbar({ value: 37 }); });
I have this code to increment a jQuery UI progressbar but when I open
I have webpage with a video element nested in a div class=video-container along with
I have a jQuery UI progressbar that acts as a timer. However when I
I have added a label to the jquery ui progressbar using this demo .
I have a JavaScript validation function and a jquery progress bar. onclick of a
Again I have a question regarding this plugin: http://t.wits.sg/2008/06/20/jquery-progress-bar-11/ What I want to achieve
Can I have text in the background of a jQuery UI progress bar? You
I have jQuery draggable set up and working ok on a table row. Currently
I have jQuery load asset on my layout and I want to use CHtml::ajaxButton/ajaxSubmitButton

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.