想知道如何切换以下代码以使用远程数据源而不是本地数组。此代码将匹配更改为“以...开头”
$("#input").autocomplete({
minLength: 1,
source: function(req, responseFn) {
var re = $.ui.autocomplete.escapeRegex(req.term);
var matcher = new RegExp( "^" + re, "i" );
var a = $.grep( group_members_array, function(item){
return matcher.test(item.value);
});
responseFn( a );
}
});