Blogger Information
Blog 35
fans 0
comment 0
visits 26577
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
定时器的种类与使用场景
锋芒天下的博客
Original
1604 people have browsed it

<!DOCTYPE html>
<html lang="en">
<head>
   <meta charset="UTF-8">
   <title>定时器的种类与使用场景</title>
</head>
<body>

<script>

   // 定时器的种类与使用场景
   // 1.一次性setTimeout()、
   // 5秒后向控制台输出一段文字,结束定时器。
   setTimeout(function(){
       console.log('我是一次性的定时器');
   },5000)


   // 2间歇性的可重复执行 setInterval().
   setInterval(function(){
       console.log('我是每3秒可重复输出的定时器');
   },3000)



</script>


</body>
</html>

Correction status:qualified

Teacher's comments:你这纯粹是演示,没有任何实际意义 , 下次写点有意义的案例, 例如做一个电子时钟
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments