📅  最后修改于: 2022-03-11 15:02:40.194000             🧑  作者: Mango
let delayTimer;
function doSearch(text) {
clearTimeout(delayTimer);
delayTimer = setTimeout(function() {
// Do the ajax stuff
}, 1000); // Will do the ajax stuff after 1000 ms, or 1 s
}