当前位置:网站首页>Functions in setinterval cannot have parentheses
Functions in setinterval cannot have parentheses
2022-06-24 07:02:00 【Haitian Eagle】
while The cycle will get stuck CPU, To use setInterval Instead of .
Only once
<script>
var i=0;
function say() {
i++;
document.write(i+'<br>');
if (i==10)
clearInterval(id);
}
var id = setInterval(say(), 100);
</script>Change to
<script>
var i=0;
function say() {
i++;
document.write(i+'<br>');
if (i==10)
clearInterval(id);
}
var id = setInterval(say, 100);
</script>setInterval Method is executed only once after the parameter is extracted
边栏推荐
- Programmers use personalized Wallpapers
- Why does the remote end receive a check-out notice when the TRTC applet turns off audio and video locally
- Thread safety and its implementation
- 线程安全与实现方法
- Are internal consultants and external consultants in SAP implementation projects difficult or successful? [English version]
- 虚拟文件系统
- C: use of mutex
- The data synchronization tool dataX has officially supported reading and writing tdengine
- 缓存操作rockscache原理图
- 【问题解决】虚拟机配置静态ip
猜你喜欢

【云驻共创】华为云HCIA-IoT V2.5培训系列内容之物联网概览

In the middle of the year, I have prepared a small number of automated interview questions. Welcome to the self-test
![[Yugong series] June 2022 asp Basic introduction and use of cellreport reporting tool under net core](/img/18/1576cb7bdae5740828d1db5b283aee.png)
[Yugong series] June 2022 asp Basic introduction and use of cellreport reporting tool under net core
![[binary tree] - middle order traversal of binary tree](/img/93/442bdbecb123991dbfbd1e5ecc9d64.png)
[binary tree] - middle order traversal of binary tree

Rockscache schematic diagram of cache operation

35岁危机?内卷成程序员代名词了

记录--关于virtual studio2017添加报表控件的方法--Reportview控件

FreeRTOS MPU makes the system more robust!

Intelligent Vision Group A4 paper recognition example

面渣逆袭:MySQL六十六问,两万字+五十图详解
随机推荐
How to operate the little red book account: making good use of the theory of long tail words
Application of O & M work order
你有一个机会,这里有一个舞台
Cloud native high availability and Disaster Recovery Series (I): pod break up scheduling
How do I turn off win10 automatic update? What are the good ways?
Why use lock [readonly] object? Why not lock (this)?
浅谈如何运营好小红书账号:利用好长尾词理论
How do I check the IP address? What is an IP address
oracle sql综合运用 习题
[Yugong series] June 2022 asp Basic introduction and use of cellreport reporting tool under net core
[5 minutes to play lighthouse] take you to the light kubernetes release k3s
Rockscache schematic diagram of cache operation
RS485 serial port wiring description of smart lamp post smart gateway
雲監控系統 HertzBeat v1.1.0 發布,一條命令開啟監控之旅!
跳跃游戏II[贪心练习]
学生管理系统页面跳转及数据库连接
Page Jump and database connection of student management system
线程安全与实现方法
【愚公系列】2022年6月 ASP.NET Core下CellReport报表工具基本介绍和使用
Arduino融资3200万美元,进军企业市场
https://jingyan.baidu.com/article/b2c186c86c3590c46ef6ffe5.html