jQuery UI Autocomplete plug-in pass in optional data for ajax call
I'm using jQuery UI Autocomplete plug-in. I'm giving it开发者_StackOverflow an URL to make an ajax call and retrieve data. I want to pass optional data parameters but not as part of URL. In the code they make a getJSON call and pass in 'request' parameter(which is an optional data parameter), however I don't see a way to get at this request parameter.
this.source = function( request, response )
{
$.getJSON( url, request, response );
};
source: function(request, response){
$.post("/path/to/url", {data:request.term, **extra:parameter**}, function(data){
response($.map(data, function(item) {
return {
/* handle response */
}
}))
}, "json");
}
精彩评论