Summernote-无法使用Ajax查看提及列表(在php中动态生成)
无法看到提及列表(用户列表在php中动态生成)并使用Ajax调用。 当键入@nothing时,我的示例代码如下-Summernote-无法使用Ajax查看提及列表(在php中动态生成),php,ajax,summernote,Php,Ajax,Summernote,无法看到提及列表(用户列表在php中动态生成)并使用Ajax调用。 当键入@nothing时,我的示例代码如下- hint: { match: /\B@(\w*)$/, mentions: function(keyword, callback) { //alert(keyword); $.ajax({ url: "userMention.php?searchstr="+
hint: {
match: /\B@(\w*)$/,
mentions: function(keyword, callback) {
//alert(keyword);
$.ajax({
url: "userMention.php?searchstr="+keyword,
type: 'POST',
dataType: "json",
async: true
}).done(callback);
},
search: function (keyword, callback) {
this.mentions(keyword, callback);
},
content: function (item) {
return '@' + item;
}
},
从上面的代码示例中,当键入@User时,我没有得到提及的列表。
php返回用户名,即['User1'、'User2'、'User3'](此列表根据传递的searchstr从数据库中动态获取)