[SetTimeout]
SetTimeout (expression, latency)
During execution, the expression is executed once after the specified time delay after loading. Remember, the number of times is once.
The effect of the random number is displayed automatically when the setTimeout function is used:
<HTML>
<Head>
<SCRIPT>
Window. onload = sett;
Function sett ()
{
Document. Body. innerhtml = math. Random ();
SetTimeout ("sett ()", 500 );
}
</SCRIPT>
</Head>
<Body>
</Body>
</Html>
[Setinterval]
Setinterval (expressiveness, interaction time)
It executes the expression once every specified time after loading.
The effect of the random number is displayed automatically when setinterval is used:
<HTML>
<Head>
<SCRIPT>
Function sett ()
{
Document. Body. innerhtml = math. Random ();
}
Setinterval ("sett ();", 500 );
</SCRIPT>
</SCRIPT>
</Head>
<Body>
</Body>
</Html>
From: http://www.cnblogs.com/ruxuan/archive/2006/07/04/442490.html