I am using ivirabyan/jquery-mentions in my project. i can do ajax request, but the problem is how can i use the response
$('textarea.mentions').mentionsInput({ source: function( request, response ) { $.ajax({ url: rootPath() + "user/tagFriends/" + request.term, type: "GET", dataType: "json", success: function(data){ alert(data); // found data here } }); }, showAtCaret: true });
Thanks in advance.
Advertisement
Answer
You can try this code, it may work
$('textarea.mentions').mentionsInput({ source: function( request, response ) { $.ajax({ url: rootPath() + "user/tagFriends/" + request.term, type: "GET", dataType: "json", success: function(data){ response(data); // Just add this line } }); }, showAtCaret: true });