js prevent jitter page (button, etc. resubmit request)

With anti-shake to prevent duplicate submission page:    

function debounce(func, wait) {
let timeout
return function () {
clearTimeout(timeout)
timeout = setTimeout(func, wait) //返回计时器 ID
}
}

use:

       debounce(doSomething, 1000);

Guess you like

Origin www.cnblogs.com/chenlongsheng/p/11112334.html