8
如何在JQuery UI自动完成中使用source:function()…和AJAX
我需要有关JQuery UI自动完成功能的帮助。我希望我的文本字段(.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; // ["one@abc.de", "onf@abc.de","ong@abc.de"] return test; // But what now? How do I display my data? }); }, minLength : …