So what I'm trying to accomplish now is actually just a simplified version of a small project I'm working on. What I'm trying to do first is to have a table of 10 rows with each row having one value in it. After 5 seconds, the function makeTable will run and increment the values in each cell. Right now, all I end up with is an endless loop where it is constantly incrementing the values if I put an alert/document.write check after the inner HTML is changed.
Ultimately, I want to replace the numbers with images, but if I can at least get the numbers working, then I can build on top of that. Any help you guys can give would be great. Thank you!
<html>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<script type="text/javascript">
document.write("<table>");
var i;
for(i=0;i<10;i++){
document.write('<tr><td id="Cell' + i + '">'+i+'</td></tr>\n');
}
document.write("</table>");
function makeTable(n){
for(i=n;i<10+n;i++){
var cell="Cell"+i;
document.getElementById(cell).InnerHTML=i+1;
}
setTimeout(makeTable(n+1), 5000);
}
setTimeout(makeTable(1), 5000);
</script>
</head>
<body>
</body>
</html>