1. 我正在尝试使用jquery-textcomplete和Unicode字符串数组。当我输入一个英文单词时,它能正常工作,但没有为我建议任何Unicode单词。我认为问题出在'term'上面。请检查下面的代码并帮助我:
var words = ['සහන', 'වනක', 'google', 'suresh namal', 'facebook', 'github', 'microsoft', 'yahoo', 'stackoverflow'];
$('textarea').textcomplete([{
match: /(^|\s)(\w{2,})$/,
search: function (term, callback) {
callback($.map(words, function (word) {
return word.indexOf(term) === 0 ? word : null;
}));
},
replace: function (word) {
return word + ' ';
}
}]);
2. 另外,回车键有问题。当我在输入完'stackoverflow'后输入'google'时,它出现为'stackoverflowgoogle'而没有空格。我该如何解决?谢谢。