[jQuery] [autocomplete] Adding data via external function

[jQuery] [autocomplete] Adding data via external function


Jorn, great work on autocomplete.
One thing I'd like to see is the ability to pull the data from a
function (instead of a static array or url). The function could
return the array instead, however it wanted to go get the data.
Imagine:
autocomplete: function(urlOrDataOrFunction, options) {
I tried to hack it in myself, making a function that returned an array
of objects,using typeof urlOrData == 'function', and then invoking the
function in the "function request(term, success, failure)" section,
but I failed. Pretty spectacularly. It seems like it should work,
but later "item" (for formatItem) comes back undefined. I'll keep
working at it.