0

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 Answer 1

2
source: function(request, response){
    $.post("/path/to/url", {data:request.term, **extra:parameter**}, function(data){     
        response($.map(data, function(item) {
        return {
            /* handle response */
        }
        }))
    }, "json");
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.