I'm looking to add an additional parameter to a jquery UI auto complete request without having to nest the json return in an ajax call. I would envision something like the following working, however the data: option is not passed over to the ajax request like it is on a normal jquery ajax request.
$("#div").autocomplete({
source: 'ajax.php',
minLength: 2,
data: '&action=getUserName',
select: function( event, ui ) {
log( ui.item ?
"Selected: " + ui.item.value + " aka " + ui.item.id :
"Nothing selected, input was " + this.value );
}
});
tl;dr I need help passing &action=getUserName
over to the ajax for my autocomplete, preferably without nesting it in an ajax callback.
Try this instead:
per docs: http://docs.jquery.com/Plugins/Autocomplete/autocomplete#url_or_dataoptions
edit: added correction based on jquery autocomplete extraParams