SetTimeout is a very good function. Front-end engineers often use it for operations executed in a few seconds. The setTimeout mentioned below can be well compatible with IE6, 7,8, 9. Currently, this setTimeout is compatible with mainstream browsers such as Google, IE6, 7, 8, and 9, Google Chrome, FireFox, Apple Safari, and Opera.
SetTimeout is a very good function, which is often used by front-end engineers on the website pages in a few seconds. SetTimeout: The JS built-in function is also easy to use. The following describes the setTimeout () function and its usage and examples and sample code:
SetTimeout () is used to specify how many milliseconds a JS function or expression code will be executed
SetTimeout usage, syntax, and parameter: setTimeout (code, millisec)
SetTimeout parameter description:
Code is a required parameter. The JavaScript code string to be executed after the function to be called.
Millisec is a required parameter. The number of milliseconds to wait before executing the code. The conversion between milliseconds and seconds is: 1000 milliseconds = 1 second
SetTimeout instance Code (the page jumps to the specified URL in 1 second ):
The Code is as follows: