如何在按键之后添加事件以使用自动完成功能,如@或#(hashtags),并将格式变量格式化为要插入的链接?
答案 0 :(得分:3)
使用jquery:jquery autocomplete
auto_options = {
serviceUrl: '/getpincodes',
width: 300,
minChars:1,
delimiter: /(@|#)\s,
deferRequestBy: 0, //miliseconds
type: "POST",
isLocal:true,
enable: true,
onSelect: function(value, data){
return data;
},
noCache: true //set to true, to disable caching
};
$(document).ready( function() {
$('#inputId').autocomplete(auto_options);
});