Home > Web Front-end > JS Tutorial > JavaScript study notes: timer_basic knowledge

JavaScript study notes: timer_basic knowledge

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 16:18:35
Original
1115 people have browsed it

Timer 1

Used to specify a program to be executed after a specific period of time.

setTimeout():

Format: [timer object name=] setTimeout(“”, milliseconds)

Function: Execute once.

Example:

Copy code The code is as follows:




timer1.html










Timer 2

Continuously execute the expression repeatedly at certain intervals.

setInterval():

Format: [timer object name=] setInterval(“”, milliseconds)

Function: Repeat until the window or frame is closed or clearInterval is executed.

clearInterval():

Format: clearInterval (timer object name)

Function: Terminate timer

Example:

Copy code The code is as follows:




timer2.html







0



The above is the entire content of this article, I hope you all like it

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
What are JavaScript hook functions?
From 1970-01-01 08:00:00
0
0
0
What is JavaScript garbage collection?
From 1970-01-01 08:00:00
0
0
0
c++ calls javascript
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template