终于找到了适合我需求的解决方案
$("#login_name").autocomplete({ source: function(request, response){ $.post("/ajax/login_name.php", {data:request.term}, function(data){ response($.map(data, function(item) { return { label: item.user_login_name, value: item.user_id } })) }, "json"); }, minLength: 2, dataType: "json", cache: false, focus: function(event, ui) { return false; }, select: function(event, ui) { this.value = ui.item.label; return false; }});


