JavaScript Progress bar is timing out.

F

Fulgore

I have been using some javascript code I found online to do a generic
progress bar for a long time. Recently, IE7 has decided that it
doesn't want to wait on it any more. It now waits about 1-2 minutes
and then displays the generic "Webpage could not be displayed"
message. Has something changed?

Here is the code I have been using. It is posting to a ASP.NET page
that I have verified is still running after IE7 gives up on it.

....[snip]...

var ctr = 1;
var ctrMax = 50; // how many is up to you-how long does your end
page take?
var intervalId;
function Begin()
{
//set this page's window.location.href to the target page
window.location.href = "<%= Request.QueryString("destPage")%>";
// but make it wait while we do our progress...
intervalId = window.setInterval("ctr=UpdateIndicator(ctr, ctrMax)",
500);
}
function End() {
// once the interval is cleared, we yield to the result page (which
has been running)
window.clearInterval(intervalId);
}

function UpdateIndicator(curCtr, ctrMaxIterations)
{
curCtr += 1;
if (curCtr <= ctrMaxIterations) {
indicator.style.width =curCtr*10 +"px";
return curCtr;
}
else
{
indicator.style.width =0;
return 1;
}
}
</script>
</HEAD>
<body onload="Begin()" onunload="End()">

....[snip]...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top