<head> <script type="text/javascript"> function animate() { document.getElementsByTagName('body')[0].innerHTML += '.'; } </script> </head> <body onload = "(function() {animate(); window.setInterval(animate, 1000)})()"> ... </body>