<html> <body bgcolor=lightcyan text=red><h1> <font color=blue> demo </font> </h1> <p> </br><p> waiting three sec!<script>var timerrvar flag=0function stopGoal(){window.clearTimeout(timerr);//alert("clearTimeout");ajaxGetData();//setTime();}function setTime(){flag=flag+1timerr=setTimeout(ajaxGetData,1000*60);console.log(flag);//console.log(flag);if(flag>=10){flag=0;//alert("stopGoal"); //stopGoal();} }function ajaxGetData(x){//alert('sorry wait');setTime();//t=setTimeout(ajaxGetData,1000*1);}</script><script>ajaxGetData( )</script></body> </html>目前的做法相當于是 每1分鐘刷新一次。
每10分鐘釋放 clearTimeout()一次 ;為什么內存還是會一直爆掉呢?求解決方法
絕地無雙
2022-11-19 17:13:16