views:

187

answers:

1

I'm using jQuery UI Autocomplete plug-in. I'm giving it 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 );
};
+1  A: 
source: function(request, response){
    $.post("/path/to/url", {data:request.term, **extra:parameter**}, function(data){     
        response($.map(data, function(item) {
        return {
            /* handle response */
        }
        }))
    }, "json");
}
bigstylee