Time is an important factor in any application, especially when programming web resources. The browser language provides the developer with two options: JavaScript setTimeout - a one-time launch of a function after a certain period of time, and setInterval - a multiple launch of a function after equal periods of time.
The setTimeout function allows you to organize temporary processes dynamically by adjusting the time intervals and executable code.
Syntax and Function Usage
JavaScript setTimeout contains two required parameters: the function to be executed and the time delay before it is executed. Instead of a function, you can specify a line of code, but this is not practiced. The desired algorithm is preferably performed in the function format.
window.setTimeout JavaScript , .
:
- dLine.innerHTML = '()<br/>';
, , :
JavaScript , . .
: 1, 2 7 . , 4 , .
setTimeout
JavaScript - . . , , JavaScript setTimeout, , , .
: - . , .
: JavaScript setTimer , .
, . . JavaScript setTimeout , .
, - .
JavaScript setTimeout
- , , .
, , , , , , ..
, . , .
( , , ). , , , .
The realization of such an opportunity can only be achieved through periodic exchange of information between local devices and the server, and it is not at all necessary that the exchange should be organized at regular intervals. The protocol for providing comprehensive communication depends on the characteristics of the business and business activity of the company.