The example in this article describes how to implement lazy loading in js. Share it with everyone for your reference. The specific analysis is as follows:
setTimeout('yourFunction()',5000); //5秒后执行yourFunction(),只执行一次 setInterval('yourFunction()',5000); //每隔5秒执行一次u
If setTimeout('yourFunction()',5000) is called again in yourFunction(), a function similar to setInterval('yourFunction()',5000) can be completed
I hope this article will be helpful to everyone’s JavaScript programming design.