views:

209

answers:

4

I would like to integrate auto-suggest on my website. Which option should I pursue? Are there any advantages with going the jQuery route vs the Javascript route? What about disadvantages?

What about having my local javascript request information from server-side JSP? I have about 10,000 keywords in my database that I'll be using.

I would appreciate some direction on this. Thank you.

A: 

You could do it in any programming language. You can study the OpenSearch specs and formats though, in order to provide something universal and reusable from third parties.

cherouvim
+3  A: 

It's not jQuery vs Javascript. jQuery is merely cleverly-written javascript purposed to make your life easier, and it does just that. In fact, rather than having to create an auto-suggest element from scratch, you can download autosuggest plugins built with/for jQuery.

As for dealing with 10,000 items, I think I would fire off asynchronous requests while the user is typing to get specific items. If the user types in "app," you could find all keywords that begin with "app" and return them as the populants of the autosuggest box. This would greatly reduce bandwith and loading times.

Jonathan Sampson
i want the auto suggest for starting keyword onwards. my db one table having 10000 keywords.....then what technology i should use..thanks
murali
A: 

In my opinion JQuery is a good option to go with. I Personally used http://docs.jquery.com/Plugins/Autocomplete and this plugin is pretty much promising.

As far as 10,000 items are concerned you can use Indexing on particular column in DB to speedup searching process.

Shoaib Shaikh
A: 

i would the following steps

create a dictionary in the client using json or something
1. wait for inputs > 4 characters in the text box 
2. send the request to server using ajax
3. use like search in your sql query.
4. send back the data to the client
5. pass the data to the text box div overlay so that it highlights.
6. add the same data set to the dictionary. this will help for later searches.
coder
i am want auto suggest for the starting word ? then what should i do?
murali
add event listener for space character. as soon as you encounter space bar key code, make a ajax request.
coder