3
I have a problem using the Select2 plugin, I need to make an AJAX request, but I need the final URL to be the following:
api/user/findbyname/name
And the way it’s coming is this:
api/user/findbyname/?q=name&_=1395243972884
My code is like this
ajax: {
    url: "/api/user/findbyname/",
    params: {
        contentType: 'application/json; charset=utf-8'
    },
    dataType: 'json',
    data: function (term) {
        return {
            q: term                    
        };
    },
    results: function (data) {
        console.log(data);
    }
}
						
You’re doing it with a
form?– Samir Braga
It’s not an input text on the screen itself, and it’s not inside a form.
– fbadaro