I first did this:
<script>
function result2() {
document.write("...");
}
function result1() {
document.write("..");
setTimeout(result2, 1000);
}
document.write(".");
setTimeout(result1, 1000);
</script>
<div id="body"></div>
setTimeout()
doesn't work at all ninety-nine times out of a hundred, so I was surprised to see it working, even if it glitched at the very end. But it didn't work like I used to want, so I re-wrote the script just a little bit to be something like that:
<script>
function result2() {
document.getElementById("body").innerHTML = "...";
}
function result1() {
document.getElementById("body").innerHTML = "..";
setTimeout(result2, 1000);
}
document.getElementById("body").innerHTML = ".";
setTimeout(result1, 1000);
</script>
<div id="body"></div>
But nothing happened at all, it just gave me a blank page... So I tried setInterval()
, but here again, it didn't work. So please, help me, how can I solve this problem?