Reputation: 334
When you write somthing on Google, it will keep what you wrote and add gray text as option to complete.
For Example:
[Black]Goo[/black][gray]le[/gray] ( The Black is what you wrote, and gray is possibility to autocomplete )
I tried to do that and success, but it was very slowly even though I use localhost.
So I'm asking for the best way to do this thing.
The list of autocomplete should to be in array such like this:
Array ( "google", "yahoo", "stackoverflow" ... )
Upvotes: 0
Views: 311
Reputation: 2994
Since you're already using jQuery, maybe consider using jQueryUI to handle autocomplete for you. You provide it the url to your PHP page which should just return a json encoded string of results based on $_GET['term'] that jQueryUI will send your url.
http://jqueryui.com/demos/autocomplete/
Upvotes: 1
Reputation: 61208
You can pre-load the list for all possible combinations of the next 2-3 characters into javascript array, and pick from it while you update the list in the background with new characters.
Upvotes: 0