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
Installation path: /application/mysql-5.7.18 1. P...
Website link: http://strml.net/ By Samuel Reed Ti...
Today someone talked to me about a website develo...
Meta tag function The META tag is a key tag in th...
1. Demand We have three tables. We need to classi...
Table of contents What is MySQL NDB Cluster Preli...
This article uses examples to describe the basic ...
Preface All hardware devices in the Linux system ...
Deploy the MySQL environment locally (192.168.1.1...
All blogs listed below are original and uniquely ...
Table of contents 1. Trigger Introduction 1. What...
Create an HTML page with an unordered list of at l...
1. Create a sequence table CREATE TABLE `sequence...
There are two ways to disable form submission in ...
Table of contents Preface Generation of redo log ...