From:
andrew whittakers example showing result numbers in a custom jquery autocomplete implementation
_response: function(contents){
$.ui.autocomplete.prototype._response.apply(this, arguments);
$(this.element).trigger("autocompletesearchcomplete", [contents]);
}
why [contents] and not contents ?
It’s a requirement from
jQuery‘striggerfunction that the second parameter be an array (prior to 1.6.2), thus the wrapping to make it an array. From the trigger docs (emphasize by me):So as of 1.6.2, it’s actually not necessary to wrap the single argument in an array.