Javascript examples for jQuery Method and Property:ajax
Clearing timeout for ajax query
<html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js"></script> </head> //from w w w.j a v a2 s . co m <body> <input id="search"> <script> function debounce(el) { var exec; $(el).keyup( function ( ) { if (exec) { clearTimeout(exec); } exec = setTimeout(function () { console.log('1'); }, 3000); }); } debounce($("#search")); </script> </body> </html>