0
$(".autocomplete").autocomplete({
minLength: 2,
selectFirst: true,
autoFocus: true,
source:
function (request, response) {
$.ajax({
type: "POST",
url: "/airports.ashx?q=" + request.term,
contentType: "application/json; charset=utf-8",
async: false,
dataType: "json",
success: function (data) {
response($.map(data, function (item) {
return { value: item }
}));
},
error: function (data) {
alert("An unexpected error has occurred during processing.");
}
});
}, select: function (event) {
}
, close: function (event, ui) {
$("#txtfrom").val(ui.item.value);
}
});
你能描述一下你的問題,或許是以問題的形式? –