Why I'm not getting any response while using mentionsInput
in my Laravel project. data is properly coming in JSON
format which I checked properly.
$(document).ready(function() {
var token = $("#csrf-token").val();
$("textarea.mentions").mentionsInput({
source: function(request, response) {
$.ajax({
url: "/snippets/getcommentedusers",
type: "POST",
dataType: "json",
data: { _token: token },
error: function(error) {
console.log(error);
},
success: function(data) {
// alert(data);
// response(data);
data = _.filter(data, function(item) {
return item.name.toLowerCase().indexOf(query.toLowerCase()) > -1;
});
callback.call(this, data);
}
});
},
showAtCaret: true
});
});