The setTimeout function is compatible with the execution results of mainstream browsers. Example _ javascript skills

Source: Internet
Author: User
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:


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.