1.setTimeOut
在指定毫秒数后调用函数或计算表达式,函数或计算表达式只执行一次
setTimeout("alert('5 seconds!')",5000)
2、setInterval
按照指定的周期来调用函数或计算表达式
setInterval("alert('hello')",1000)
3、clearInterval
可以取消setInterval的设置,setInterval返回的值可以作为clearInterval方法的参数
var helloStr = setInterval("alert('hello')",1000);clearInterval( helloStr);