Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

summernote mentions ajax

$(document).ready(function()
{
    $('.editor').summernote({
        height: 300,
        hint: {
            match: /B@(w*)$/,
            users: function(keyword, callback) {
                $.ajax({
                    url: '/users/' + keyword,
                    type: 'get',
                    async: true //This works but freezes the UI
                }).done(callback);
            },
            search: function (keyword, callback) {
                this.users(keyword, callback); //callback must be an array
            },
            content: function (item) {
                return '@' + item;
            }
        }
    });
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #summernote #mentions #ajax
ADD COMMENT
Topic
Name
2+4 =