javascriptjqueryautocompletejquery-autocomplete

JavaScript autocomplete upon typing


Right guys, all autocomplete plugins and functions that I've found, they only update upon keyup/down, etc. This is fine but the search only begins occurring once the user has stopped typing and if they are typing a phrase or word, the script is unable to instantly start suggesting, etc.

I know this'll be a very simple fix or suggestion for some of you guys, so any help would be greatly appreciated as to how I can convert it to be instantly as a key is pressed.

An example of the desired effect is Google Suggest or Facebook search, a search is fired instantly per key press or change, how do I emulate this?

Thanks!


Solution

  • It depends on how big the space you're searching is and how good your servers are. Facebook search for (I assume people's names) is quick because you're only really searching through a thousand or so contacts. Google is fast because they invest a lot of money in infrastructure and cache a lot of the responses.

    On one of my projects I've used this jQuery plugin and it provides excellent performance on cached results. We used it to provide autocomplete functionality on a list of about 6K contacts (names, etc). Is this what you had in mind?