1. I am trying to use jquery-textcomplete with an array of Unicode strings. When I type an English word, it works correctly, but Unicode words are not suggested. I think the problem is with the "term". Check out the code below and please help me out:
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 + ' ';
}
}]);
Js feed
2. There is also a problem with the return key. When I type google after stackoverflow, it looks like stackoverflowgoogle. There is no space between "stackoverflow" and "google". How can i solve this? Thank.
namal source
share