1.setInterval()Calls the function at a specified interval (in milliseconds). The method will keep calling the function until grammar: setInterval(code,millisec,[arg1, arg2, ...])
2.setTimeout()Calls a function after the specified number of milliseconds. grammar: setTimeout(code,millisec,[arg1, arg2, ...]); //parameters have the same function as above Final code demonstration: //1. You can write setTimeout directly using arrow function(()=>{ this.isSkeleton=false; },2000) //2. You can return a value and then call clearTimeout() to cancel the timer; let a = setTimeout(()=>{ alert('popup'); },5000); function b() { window.clearTimeout(a); // Pop-up window appears after 5 seconds, calling b function can directly cancel the pop-up.} Return value: The return value Finally, some knowledge: JS objects can be obtained in two ways: one is customized by the developer; the other is provided by The timer is provided by This is the end of this article about the summary of JavaScript timer types. For more information about JavaScript timer types, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope you will support 123WORDPRESS.COM in the future! You may also be interested in:
|
<<: Solution to PHP not being able to be parsed after nginx installation is complete
Quick Reading Why do we need to monitor SQL state...
Use native JS to write a nine-square grid to achi...
Scenario 1: Html: <div class="outer"...
Prepare the database (MySQL). If you already have...
This article example shares the specific code for...
In the process of writing the project page, I enc...
Table of contents Preface Summary of the principl...
<meta http-equiv="X-UA-Compatible" c...
Click here to return to the 123WORDPRESS.COM HTML ...
1. Performance schema: Introduction In MySQL 5.7,...
Basics A transaction is an atomic operation on a ...
UCenter Home is an SNS website building system rel...
1. Add the plug-in and add the following configur...
This article example shares the specific code of ...
Preface We all know that MySQL query uses the sel...