I have a problem using the Select2 plugin, I need to make an AJAX request, but I need the final URL to be as follows:
api/user/findbyname/name
And the way it's coming is this:
api/user/findbyname/?q=name&_=1395243972884
My code is this way
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);
}
}