G
Guest
Hi,
I have a Javascript function that loads a page with a progress bar for long
process. The progress bar is a gif animation and for some reason it the
animation is stuck when the function is called so it looks like an image and
not an animation. I have decided to put a wait function that will pause for 3
sec so that the animation will be loaded then the call the function for the
long process.
This is the <SCRIPT> section
<SCRIPT language="javascript">
<body MS_POSITIONING="GridLayout"
onload="pause('<%Response.Write(redirectPage)%>','<%Response.Write(Request.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minutesToWait)%>')">
var i = 0;
function redirectTo(targetPage, querystring, secondsForWaiting,
minutesForWaiting)
{
if (0 < targetPage.length)
{
location.replace(targetPage + querystring);
if (secondsForWaiting.valueOf() > 0)
{
msgLabel.innerText =
"This process can take up to "
+ secondsForWaiting + " seconds...";
timedIterations(secondsForWaiting);
}
else
{
if (minutesForWaiting.valueOf() > 0)
{
msgLabel.innerText =
"This process can take up to "
+ minutesForWaiting + " minutes...";
timedIterations(minutesForWaiting * 60);
}
}
}
else
{
msgLabel.innerText = "Page not found."
}
}
function timedIterations(secondsForIterating)
{
incrementalWidth = 800 / secondsForIterating;
if (i <= secondsForIterating + 10)
{
setTimeout(
"timedIterations(" + secondsForIterating + ");",
1000);
i++;
}
else
{
ProcessingLabel.innerText =
"The server is taking longer than "
+ "anticipated to process your request. "
+ "Thank you for your patience. "
+ "You can wait a few minutes longer for "
+ "the process to complete, or you can press "
+ "the back button and try again later...";
}
}
function pause(targetPage, querystring, secondsForWaiting,
minutesForWaiting)
{
setTimeout('redirectTo(targetPage, querystring, secondsForWaiting,
minutesForWaiting)',3*1000); <========== I am having the error here.
}
</SCRIPT>
this is the load event of my form
<body MS_POSITIONING="GridLayout"
onload="pause('<%Response.Write(redirectPage)%>','<%Response.Write(Request.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minutesToWait)%>')">
On the load event I call the pause() FUNCTION which then pause for 3 secs so
that the page with the animation is loaded then the pause() FUNCTION calls
the function the calls the page with the long process. The problem is when my
page loads and call the pause function I get the runtime error:
"A runtime error has occured
Line 74
Error: Unterminated string constant"
Any ideas?
Thanks
I have a Javascript function that loads a page with a progress bar for long
process. The progress bar is a gif animation and for some reason it the
animation is stuck when the function is called so it looks like an image and
not an animation. I have decided to put a wait function that will pause for 3
sec so that the animation will be loaded then the call the function for the
long process.
This is the <SCRIPT> section
<SCRIPT language="javascript">
<body MS_POSITIONING="GridLayout"
onload="pause('<%Response.Write(redirectPage)%>','<%Response.Write(Request.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minutesToWait)%>')">
var i = 0;
function redirectTo(targetPage, querystring, secondsForWaiting,
minutesForWaiting)
{
if (0 < targetPage.length)
{
location.replace(targetPage + querystring);
if (secondsForWaiting.valueOf() > 0)
{
msgLabel.innerText =
"This process can take up to "
+ secondsForWaiting + " seconds...";
timedIterations(secondsForWaiting);
}
else
{
if (minutesForWaiting.valueOf() > 0)
{
msgLabel.innerText =
"This process can take up to "
+ minutesForWaiting + " minutes...";
timedIterations(minutesForWaiting * 60);
}
}
}
else
{
msgLabel.innerText = "Page not found."
}
}
function timedIterations(secondsForIterating)
{
incrementalWidth = 800 / secondsForIterating;
if (i <= secondsForIterating + 10)
{
setTimeout(
"timedIterations(" + secondsForIterating + ");",
1000);
i++;
}
else
{
ProcessingLabel.innerText =
"The server is taking longer than "
+ "anticipated to process your request. "
+ "Thank you for your patience. "
+ "You can wait a few minutes longer for "
+ "the process to complete, or you can press "
+ "the back button and try again later...";
}
}
function pause(targetPage, querystring, secondsForWaiting,
minutesForWaiting)
{
setTimeout('redirectTo(targetPage, querystring, secondsForWaiting,
minutesForWaiting)',3*1000); <========== I am having the error here.
}
</SCRIPT>
this is the load event of my form
<body MS_POSITIONING="GridLayout"
onload="pause('<%Response.Write(redirectPage)%>','<%Response.Write(Request.Url.Query)%>','<%Response.Write(secondsToWait)%>','<%Response.Write(minutesToWait)%>')">
On the load event I call the pause() FUNCTION which then pause for 3 secs so
that the page with the animation is loaded then the pause() FUNCTION calls
the function the calls the page with the long process. The problem is when my
page loads and call the pause function I get the runtime error:
"A runtime error has occured
Line 74
Error: Unterminated string constant"
Any ideas?
Thanks