69

说说 JavaScript 中函数的防抖 (Debounce) 与节流 (Throttle)

 5 years ago
source link: https://juejin.im/post/5d07a51b5188254dd63c21ce
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client
为何要防抖和节流 有时候会在项目开发中频繁地触发一些事件,如 resize、 scroll、 keyup、 keydown等,或者诸如输入框的实时搜索功能,我们知道如果事件处理函数无限制调用,会大大加重浏览器的工作量,有可能导致页面卡顿影响体验;后台接口的频繁

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK