js implements the lazy loading method

  • 2020-06-19 09:44:42
  • OfStack

This article gives an example of how js implements lazy loading. Share to everybody for everybody reference. The specific analysis is as follows:


setTimeout('yourFunction()',5000);
//5 Seconds after implementation yourFunction(), Only perform 1 time  
setInterval('yourFunction()',5000);
// every 5 Seconds to perform 1 time u 

If you call setTimeout('yourFunction()',5000) again in yourFunction(), you can do something similar to setInterval('yourFunction()',5000)

Hopefully, this article has helped you with your javascript programming.


Related articles: