Hi,
I am using JQuery's autocomplete plugin, but it is not fast and also it's not that relevant to my site. I want an autocomplete like the www.hotels.com. How can I achieve this type of autocomplete? Are there plugins for it?
Hi,
I am using JQuery's autocomplete plugin, but it is not fast and also it's not that relevant to my site. I want an autocomplete like the www.hotels.com. How can I achieve this type of autocomplete? Are there plugins for it?
Thus, you rather want a dropdown filter instead of dropdown autocomplete? E.g. when you type "foo" you would like to get "foobar", "afooba" and "bazfoo" listed instead of only the starting-matches like "foobar" and "foobaz"?
If so, then I can suggest the Quickselect using Quicksilver algo or Flexselect using Liquidmetal algo. For what's worth, I've played with both about a year ago and decided to continue with the last one, because it was better customizeable to get it compatible with the other jQuery plugins (e.g. Validator and qTip).
What is it about www.hotels.com that you like? What data do you want to project into the autocomplete? Where would this data come from? You need to answer these questions before thinking about implementation details.
Hotels.com uses a custom JSON request/response. If you open up firebug you'll see the outgoing call:
This call is fired immediately on keyup, and returns JSON data:
There's nothing particularly fancy going on otherwise, just a high powered server with an accurate database search. There's no autocomplete happening in Javascript though.
Good things costs money. In this particular benchmark exercise you're doing, if you look close enough, you'll be able to see that hotels.com uses the Yahoo JS framework and different custom functions...
80% of the work in autocompletion is done in the backend. THe backend needs to be really really quick to return query responses. I doubt if jquery is your problem. Use firebug's 'net' panel to understand how much round trip time is, and what the server latency is. Solve that problem. The rest is easy. FWIW, I have had very good luck using GWT's suggestbox going directly into a oracle database (I dispensed with most of the web tier other than a very thin passthrough to get the responsiveness I was looking for). Response back to the user in approx 50ms