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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T04:27:04+00:00 2026-06-03T04:27:04+00:00

There appear to be two issues with the original question: 1) The sleep function

  • 0

There appear to be two issues with the original question:
1) The sleep function didnt properly simulate a long running operation such as an HTML request.
2) IE, at least v8 and v9 dont appear to update their display correctly the way Firefox does. Anyone know a way to force IE to process the UI update?
The following works fine on Firefox but IE Doesnt update the display of the running count until the end unless I insert an alert which forces a pause. If there are 50 items and the batch size is 10, I wanted the HTML displaying the running count to show 10,20,30,40,50. In IE it jumps from 10 to 50 at the end whereas Firefox updates correctly.

while (done == false) {
    var url = 'myLongRunningOperation.com/doSomething.html&LastID='+lastPriorIndex;
    $.ajax({
    type: 'GET',
    url: url,
    dataType: 'json',
    success: function(data) { 
        soFar += data.Succeeded + data.Failed;
        $('#numCompleted').val(soFar).show();
        LastPriorIndex= data.LastID;
        if (soFar >= totalNumberOFDocs) {
        done = true;
        }
    },
    data: {},
    async: false
    });
}

I’m trying to use a JQuery UI modal dialog as a status dialog. First it should display, then process the update messages as a long running operation completes and adds to the HTML. However, the dialog doesnt display till the very end and then shows up with all of the messages. If I put in an alert just after showing the dialog, it will show but the message updates all show up at once after the operations are all done. I’m hoping all I need is some sort of check-the-message-queue function to get it to update because the alert causes the dialog to show. Or possibly it’s my method of simulating a log running operation that’s the problem in simulating a sleep.

    $(function() {
        $("#dialog2").dialog({
            bgiframe: false
            ,height: 140
            ,modal: true
            ,autoOpen: false
        });

    });
    function TestModalUpdate2() {
        $('#dialog2').dialog("open");
        //alert('foo'); //if this alert is present the dialog shows before the doSomething calls execute but wont update till all of them are done
        $('#dialog2').show();
        var i
        for(i = 0; i < 5; i++) {
            doSomething($('#dialog2'));
            $('#dialog2').show();
        }
    }

    function doSomething(obj1) {
        wait(1000);
        obj1.html(obj1.html()+"<p>new line</p>")
                //alert('this will also cause the dialog to update in between doSomethings')
    }
    function wait(msecs) {
        var start = new Date().getTime();
        var cur = start
        while(cur - start < msecs) {
            cur = new Date().getTime();
        }
    } 
<input type="button" id="Test2" onclick="TestModalUpdate2();" value="Test2"/>
  • 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-03T04:27:06+00:00Added an answer on June 3, 2026 at 4:27 am

    After further research indicating that operating in synchronous mode can be troublesome, I converted it to a recursive version which worked.

    function processBatch() {
        var url = 'DoSomethingLongRunning.html&StartingIndex='+startingIndex+'&BatchSize='+batchSize;
        $.getJSON(url 
            ,function(data) { 
                soFar1 += data.Succeeded + data.Failed;
                $('#numCompleted').val(soFar1).show();
                startingIndex = data.LastID;
                if (soFar1 < totalNumberOfDocs) {
                    processBatch();
                }
            }
        );  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

These two methods appear to behave the same to me public IEnumerable<string> GetNothing() {
There does not appear to be any good software to mount an FTP to
There doesn't appear to be a generic implementation of OrderedDictionary (which is in the
Is there a way to get some text to appear only when the [draft]
Making websites that appear correctly in IE is a big problem. Is there any
The Maven Buildnumber plugin doesn't appear to work with GIT yet. Is there a
From the answers to this question it appears there's a file somewhere on our
In medical imaging, there appears to be two ways of storing huge gigapixel images:
I know, @SecondaryTable issues were published numerous times, so, if there is the same
Here's the jfiddle for what I'm trying to achieve: http://jsfiddle.net/fmvmA/ I have two issues

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.