Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

delay input javascript

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
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delay #input #javascript
ADD COMMENT
Topic
Name
7+1 =