Re: [jQuery] Re: delay ajax search while using keyup

2010-01-14 Thread Amos King
If you do this on keydown and key up then it will only stop the call when they have a key pressed. My suggestion is to set the var on keyup use setTimeout to call a function one second after the keyup to set the var back to true. Create another setTimeout on the keyup for 1.1 seconds that checks

[jQuery] Re: delay ajax search while using keyup

2010-01-14 Thread mslade
Here's what I would do. Hope this makes sense: [0] On key down, set some global state variable to true. [1] On key up, set the state variable to false. [1a] Then use setTimeout() to have it call a new function in 1 second (adjust for usability). [2] Your new function will look to to see if