473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

AJAX Progress bar

I am working on a servlet that takes fairly long to process, and I
would like to keep the user updated on the progress with a status bar.

I have already finished the necessary javascript and servlet code: The
local script regularly polls the servlet, which uses the session to
check on the progress of the other program and reports back with an
XML file. The local script then updates the progress bar as necessary.

This works nicely until I actually place it into a form. Apparently,
submitting a form and "leaving" the current page in the browser
somehow suspends the Javascript until the new page is built, which
means that nothing happens while the servlet result page is loading.
How can I make the progress bar script run until the server actually
sends a response to my form submission, and the page is rebuilt?
Feb 12 '08 #1
1 2684
SAM
Arancaytar a écrit :
I am working on a servlet that takes fairly long to process, and I
would like to keep the user updated on the progress with a status bar.

I have already finished the necessary javascript and servlet code: The
local script regularly polls the servlet, which uses the session to
check on the progress of the other program and reports back with an
XML file. The local script then updates the progress bar as necessary.

This works nicely until I actually place it into a form. Apparently,
submitting a form and "leaving" the current page in the browser
somehow suspends the Javascript until the new page is built, which
means that nothing happens while the servlet result page is loading.
How can I make the progress bar script run until the server actually
sends a response to my form submission, and the page is rebuilt?
a gif-anim ? showed/hidden when necessary.
function progressBar(yesNo) {
if(yesNo)
myBar = setInterval(function(){$('bar').innerHTML += '+';},300);
else { clearInterval(myBar); $('bar').innerHTML = '';}
}

function queryHttpRequest ( url, argts ) {
progressBar(true);
http_request = new ... blah

if(http_request) {
blah
http_request.onreadystatechange = function() {
progressBar(false);
blah ...
};
blah ...
}
}

Really the JS waiting bar is blocked during the request ?
I can't test because I havn't slow requests.

--
sm
Feb 12 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: JMB | last post by:
Hello, I was wondering if anyone knew of any projects extending the inline upload progress bar to utilize an inpage image uploader with bar, without having to refresh or go to a seperate page,...
3
by: markus.rietzler | last post by:
i want to do (multiple) file upload(s) and display a progress bar. with firefox and safari it is no problem at all. only IE makes some problems. my script is based on ajax-uploader, which can be...
13
by: Marvin Zhang | last post by:
Hi, I'm not familiar with web programming, but I have a problem here. I have a page. When a user click one button on it, I will use AJAX to request a PHP script which will do a bunch of tasks,...
6
by: mattdaddym | last post by:
Hi all, I'm looking for a way to show my users the progress of their sql queries. I've implemented Microsoft Ajax in order to show a progress bar, but I would love to be able to show: number...
1
by: Mike P | last post by:
I am trying to apply the Update Progress control to a method that is building a zip file and then giving the user the chance to save the file via a popup box. But the Update Progress control...
3
by: Ken1 | last post by:
Hello, Does anyone know of an easy to implement ajax upload script for php which also has a progress bar. If possible I'd like it to be able to remove already uploaded files and do minor...
16
by: deostroll | last post by:
Suppose I have an asp page that has a response.write(something) in a loop that would run for a considerable amount of time. Now, from my client browser can I trap those server response messages...
1
by: gamernaveen | last post by:
Hey guys , am just getting into the AJAX scene and am a noob. I am really worried about Ajax upload , cant figure it out. I have a basic html form , like this <form action="upload.php"...
5
by: =?Utf-8?B?SmFzb24gSGFydHNvZQ==?= | last post by:
I am writing an application in .net 3.5 (VB.net) using VS 2008. I am interacting with a stored procedure (MS SQL) and want to return status updates back to the user client side. I'm copying...
1
by: bizt | last post by:
Hi, I am having my first real attempt at an ajax class as so far Ive managed to build one that, once instatiated, will allow me to define which function it will call on completion then retrieves...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.