PLAIN TEXT
JAVASCRIPT:
1.
2.
<script src="jquery-1.2.1.pack.js" type="text/javascript"></script><script type="text/javascript">
3.
4.
function lookup(inputString) {
5.
if(inputString.length == 0) {
6.
// Hide the suggestion box.
7.
$(‘#suggestions’).hide();
8.
} else {
9.
$.post("rpc.php", {queryString: ""+inputString+""}, function(data){
10.
if(data.length>0) {
11.
$(‘#suggestions’).show();
12.
$(‘#autoSuggestionsList’).html(data);
13.
}
14.
});
15.
}
16.
} // lookup
17.
18.
function fill(thisValue) {
19.
$(‘#inputString’).val(thisValue);
20.
$(‘#suggestions’).hide();
21.
}
22.
</script>
23.
source: ajaxian