Regular JS execution

Source: Internet
Author: User
<Script language = "JavaScript" type = "text/JavaScript"> // After setTimeout, the specified content is executed at a fixed time, unit: millisecond // write 1/* var IID = setTimeout (function () {alert (IID) ;}, 1000 ); * /// method 2 var IID = setTimeout ("clock ()", 2000); // or var IID = setTimeout (clock, 2000); function clock () {alert (IID) ;}cleartimeout (IID); // setinterval is used in the same way as setTimeout. It is executed only once after setTimeout is fixed. The setinterval loop is executed every time. // Each time you call the setTimeout or setinterval function, a unique ID is generated. You can use the cleartimeout or clearinterval functions (the parameters of these two functions correspond to the IDS returned by setTimeout or setinterval) pause the setTimeout or setinterval functions (the return value remains the same for the same setinterval loop) // But test clearinterval (IID) to block setTimeout, cleartimeout (IID) it can also prevent the execution of setinterval. </SCRIPT>

 

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.