【资料图】
1、function jump(){ alert("5秒")}setInt=setInterval("jump()",2000);
2、需要用window.clearInterval(setInt);这个函数去停止循环
3、setTimeout只调用一次
4、setTimeout("showTime()",5000); //延迟5秒刷新页面function showTime(){ alert(1);}
5、两者之间的区别就是setTimeout只可调取一次,setInterval会一直循坏调用,要想停止,可用window.clearInterval( );
在用法上可根据功能需求去调用方法
7、
本文到此结束,希望对大家有所帮助。
关键词: