I am using a simple ajax function to look up results based on text entered into a text field.
My function is called on the onkeyup event, which currently delays the ajax call until at least 4 characters have been typed.
However I would also like to delay the ajax call if they are still typing. So I was thinking it should wait a second to see if they have stopped entering text.
Can someone show me how to do this please.
var st = searchtext;
var l = st.length;
if (l > howlong)
document.getElementById(divtag).innerHTML = '';