如何在這個 jQuery 函式上應用 debouncer。到目前為止,它沒有打電話。
$('.make-ajax-call-js').on($.debounce('change', function (e) {
//whatever ajax call
}));
我的 js 檔案中包含 debouncer 腳本。
uj5u.com熱心網友回復:
試試這樣:
$('.make-ajax-call-js').change($.debounce(1000, function(e) {
console.log("It works!");
}));
uj5u.com熱心網友回復:
要解決此問題,您必須將去抖動函式作為引數傳遞給 jquery click 事件以及去抖動時間
$('.make-ajax-call-js').click($.debounce(250, function(e) {
//whatever ajax call
}));
轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/449425.html
標籤:javascript jQuery 阿贾克斯 改变
