Hello! よこそ สวัสดี 환영

Here is an implementation of JavaScript auto-complete, similar to Google Suggest and many other sites as listed below. The special feature about this implementation is the support of multi-character input, other systems will only accept single keyboard character strings. In order to support such input the HTML input control needs to be periodically polled for input changes, the JavaScript event system does not fire events when entering a multi-character ideogram. This project concentrates on the JavaScript, or client side of the system, in order to integrate auto-complete functionality into a project you will also need a server side component that implements some kind of searching. The server side system can be in any language (ASP, JSP, PHP, Ruby, etc) or platform as long as it can handle simple HTTP requests, the examples on this site are in PHP and kept deliberately simple. A typical deployment would query against a SQL database such as MySQL, or Microsoft SQL Server.

Documentation and source are provided.

auto-complete example

Example

Please test the script with the following input elements, you can enter in English, Japanese, Korean, or Thai.

すこし いろい は 日本語 で あります。

ตรงนี้มีชื่อสีในภาษาไทยตั้งหลายสี

Colour: (and submit)
Colour: (10s throttle)
Colour: (fill with search term)
Country: (highlight search term)

Download

ac.zip 156989 bytes, 2005/05/07 changes (licensed under the LGPL).

This package includes everything on site, including basic examples in PHP and all documentation.

Further information

Please read the online documentation on how this works and how to implement in your own website.

Bugs:

Notes:

Features:

Similar projects:

There are many different variations of auto-complete on the web, quality varies, as does platform support, whether they support XmlHttpRequest() or iframes, or are client site only. Some projects offer a nice clean interface, or even abstracted away in a language like Ruby, some are messy and can be used once per HTML page and are difficult to adapt to new applications. Please research around to find the best solution to your needs.

This project, whilst featured, might not be suitable for everyones needs, please look at something like Script.aculo.us which includes many DHTML effects and a remoting library.

1 Amazon Zuggest auto-searches rather than auto-completes.
2 Includes a nice diagram of how it works.
3 Blatant copy of google.com code.
4 Appears to be disabled server side.
5 Searching done client side, data can be downloaded from server.
6 Only deals with <IFRAME> communication.
7 Actually looks like Google autocomplete, however attempts to abstract away code although looks rather daunting, does not support multi-character input.

 

maintained by (© 2005)
(ホーム)