如何在JQuery UI自動完成中使用source:function()...和AJAX我需要一些JQuery UI Autocomplete的幫助。我希望我的textfield(.suggest-user)顯示來自AJAX請求的名稱。這就是我所擁有的:jQuery("input.suggest-user").autocomplete({
source : function(request, response) {
var name = jQuery("input.suggest-user").val();
jQuery.get("usernames.action?query=" + name, function(data) {
console.log(data); // Ok, I get the data. Data looks like that:
test = data; // ["[email protected]", "[email protected]","[email protected]"]
return test; // But what now? How do I display my data?
});
},
minLength : 3});很感謝任何形式的幫助。
如何在JQuery UI自動完成中使用source:function()...和AJAX
繁花如伊
2019-08-27 13:37:43
