1
我有這個js腳本:jQuery的自動完成功能不顯示結果框
$('#other_teacher').autocomplete({
source: function (request, response) {
$.ajax({
url: '/app_dev.php/en/teacher/ajax/courseadd-teacher/'+request.term,
type: 'GET',
dataatType: 'json',
success: function(data) {
console.log(data);
response($.each(data, function(index, value) {
return {
label: value,
value: index
}
}));
}
});
},
minLength: 1
});
和Ajax請求的結果是:
[{"id":2,"name":"Moran bob"},{"id":2,"name":"Willam Lawsan"}]
阿賈克斯resquest開始,數據有結果的對象,但結果窗口不顯示。
你能張貼您的HTML也請 – dcodesmith
把這個CSS http://code.jquery.com/ui/ 1.10.3/themes/smoothness/jquery-ui.css並嘗試使用我們的代碼或我的 – Dinesh
有什麼好運?這是一個很好的做法,讓我們知道你的進步 – dcodesmith