Thanks Bear and Ulf! I clearly wasn't thinking about JSP vs. Javascript and thank you both for helping me focus on client vs. server. (
Java Ranch to the Rescue!!! <s>
I came up with the following functions below to "animate" my charts. I see that there's no built in way to pause execution "between" Javascript statements (rather the pause is between calls to a function).
So, assuming I have three JPEGs, chart1, chart2, and chart3, I wrote the functions as you see below.
Can these be improved? What if I had 100 (or 1000) images I wanted to animate with a 1 second delay between images. I don't see how Javascript makes this delay easy. I'd hate to add 1000 "if else" clauses to the code below for each image!
Look forward to any updates and replies!
Thanks.
mike
---------------
function showChart()
{
var timeOut = setTimeout("nextChart(1)", 2000);
var timeOut = setTimeout("nextChart(2)", 3000);
var timeOut = setTimeout("nextChart(3)", 4000);
}
function nextChart(nextChart)
{
if (nextChart == 1)
{
document.chart.src = "chart1.jpg";
}
else if (nextChart == 2)
{
document.chart.src = "chart2.jpg";
}
else
{
document.chart.src = "chart3.jpg";
}
}