PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Monday, March 7, 2022

[FIXED] ivirabyan/jquery-mentions how to check ajax request respone

 March 07, 2022     ajax, javascript, jquery, php     No comments   

Issue

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.


Solution

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
}); 


Answered By - Snehasish Sarker
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing