39

JS的节流、函数防抖 原理及使用场景

 5 years ago
source link: https://juejin.im/post/5b961773f265da0a9e52f0e3
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.
概念和例子 函数防抖(debounce) 在事件被触发n秒后再执行回调,如果在这n秒内又被触发,则重新计时。 看一个?(栗子): //模拟一段ajax请求 function ajax(content) { console.log('ajax requ

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK