[導(dǎo)入]AJAX Auto-complete component
Posted on 2006-03-16 11:19 BlueO2 閱讀(902) 評論(0) 編輯 收藏 所屬分類: AJAX
AutoAssist is an auto completion web widget that written in pure JavaScript. It can help enhance the accessibility of existing website, let the users to work effective and feel comfortable. AutoAssist Javascript only and is built upon prototype and rico. Its main features are :
* improve the User Experience
* Don't require an Ajax experience
* pretty managed JavaScript, easy to understand and customize
* works well on Mozilla/FireFox, IE and Opera
* have a nice solution for fast user typing, reduce a lot of corresponding server loading (20% - 80% *)

The code for the screenshot is very simple :
var foo = function() {
var tt = new AutoAssist("t", {setRequestOptions: function() {
var pars = "name=" + this.txtBox.value;
return { url: "/country.php", parameters: pars };
}});
}
Event.observe(window, "load", foo);
You can find a ten minutes tutorial for AutoAssist explaining in details how to use this script to create an auto-complete list based on country data.
By the way,script.aculo.us also has it's impelmention:http://demo.script.aculo.us/ajax/autocompleter
文章來源:http://blueoxygen.dflying.net/3/archive/53_ajax_auto-complete_component.html