
TODO
- allow users to keep their incomplete value when pressing tab, just mimic the default-browser-autocomplete: tab doesn't select any proposed value -> tab closes the select and works normal otherwise
- small bug in your autocomplete,  When setting autoFill:true I would expect formatResult to be called on autofill, it seems not to be the case.
- add a callback to allow decoding the response
- add scrollbars and page down/up, option for height or number of items to be visible without scrolling
- allow modification of not-last value in multiple-fields
@option Number size Limit the number of items to show at once. Default: 
@option Function parse - TEST AND DOCUMENT ME
- add option to display selectbox on focus

$input.bind("show", function() {
	if ( !select.visible() ) {
		onChange(0, true);
	}
});

- reference: http://capxous.com/
  - add "try ..." hints to demo
  - check out demos
  
- add option to hide selectbox when no match is found - see comment by Ian on plugin page (14. Juli 2007 04:31)
- add example for reinitializing an autocomplete using unbind()

Thanks for a powerful and useful script :)
You may already have provided some sort of option, that I have missed, to counter the following issue. If not, I will suggest the addition of a unique generated anti cache parameter in the request function, like this:

data: jQuery.extend({
q: lastWord(term),
limit: options.max,
antiCache: new Date().getTime()
}, options.extraParams),

Otherwise especially Internet Explorer will generally reuse a cached page rather than accessing the query script, which albeit can make sense unless the data in question is frequently updated.

- Add option to pass through additional arguments to $.ajax, like type to use POST instead of GET

 - I found out that the problem with UTF-8 not being correctly sent can be solved on the server side by applying (PHP) rawurldecode() function, which decodes the Unicode characters sent by GET method and therefore URL-encoded.
-> add that hint to docs and examples

But I am trying this with these three values: “foo bar”, “foo foo”, and “foo far”, and if I enter “b” (or “ba”) nothing matches, if I enter “f” all three do match, and if I enter “fa” the last one matches.
The problem seems to be that the cache is implemented with a first-character hashtable, so only after matching the first character, the latter ones are searched for.

xml example:
<script type="text/javascript">
      function parseXML(data) {
        var results = [];
        var branches = $(data).find('item');
        $(branches).each(function() {
          var text = $.trim($(this).find('text').text());
          var value = $.trim($(this).find('value').text());
          //console.log(text);
          //console.log(value);
          results[results.length] = {'data': this, 'result': value, 'value': text};
        });
        $(results).each(function() {
          //console.log('value', this.value);
          //console.log('text', this.text);
        });
        //console.log(results);
        return results;
      };
    $(YourOojHere).autocomplete(SERVER_AJAX_URL, {parse: parseXML});
  </script>
<?xml version="1.0"?>
<ajaxresponse>
  <item>
    <text>
      <![CDATA[<b>FreeNode:</b> irc.freenode.net:6667]]>
    </text>
    <value><![CDATA[irc.freenode.net:6667]]></value>
  </item><item>
    <text>
      <![CDATA[<b>irc.oftc.net</b>:6667]]>
    </text>
    <value><![CDATA[irc.oftc.net:6667]]></value>
  </item><item>
    <text>
      <![CDATA[<b>irc.undernet.org</b>:6667]]>
    </text>
    <value><![CDATA[irc.undernet.org:6667]]></value>
  </item>
</ajaxresponse>
  
  
  
  
  
The issue with the highlight function is that if you insert HTML into
the formatted strings, the highlight option will parse the HTML as
well.

EXAMPLE:
function formatItem(row, pos, num) {
   return row[0] + "<br><span class='small-text'>Position: " + row[2]
+ "</span>";
}

In the previous example we are getting "name|employeeid|title" from
the server. We want to format the autocomplete selector to display the
name with the title underneath in small letters. This would seem to
work.

PROBLEM:
The hightlight() function becomes a problem if you search for "sp" or
"cl" or "sm" or "te"...

If you search for 'sp' the output becomes:
Lisa <strong>Spinach</strong> <br><<strong>sp</strong> class='small-text'>...

'sm' will clobber:
<span <strong>cl</strong>ss='small-text'>

SOLUTION:
Add the ability to turn off highlight() and pass the search term to
the formatItem custom function to do custom highlighting

function formatItem(row, pos, num, term) {
       return row[0].replace(new RegExp("(" + term + ")", "gi"),
"<strong>$1</strong>") + "<br><span class='small-text'>Position: " +
row[2] + "</span>";
}

This allows to only add the emphasis to the strings before they are
wrapped with HTML formatting.