I have created a custom jquery plugin using at.js like this,
(function ($) {
$.fn.mention = function (options) {
    var defaults = {
        at: "@",
        dataType: "json",
        source: "",
        data: {}
    };
    var settings = $.extend({}, defaults, options);
    $.ajax({
        url: settings.source,
        data: settings.data,
        dataType: settings.dataType,
        method: "POST",
        success: function (result) {
            if (result.success) {
                $(this).atwho({
                    at: settings.at,
                    data: result.data
                });
            }
        }
    });
};
})(jQuery);
I am using the plugin like this,
$('#textbox').mention({
    source: "<?php echo_uri("..some_links"); ?>",
    data: {some_data: some_data_value}
});
And the data on ajax success, produce the exact json array that I need. I want to mention here that, if I add data manually in atwho(), it's smoothly working. But these method doesn't working.
Please provide any solution.
Thanks in advance.
 
     
    