我有一個小問題得到這個工作。Bootstrap Typeahead只顯示第一個字母
服務器響應正確的json請求,但是typeahead只顯示我返回結果的第一個字母。例如,如果我K型它將顯示:
ķ
ķ
ķ
ķ
你能不能幫我找出爲什麼?
這裏是我的js
$('.user').typeahead({
source : function(typeahead, query) {
return $.post('getUser', {
query : query
}, function(data) {
return typeahead.process(data);
});
}
});
和我的HTML
<input autocomplete="off" type="text" size="16" id="appendedInputButton" class="user" data-provide="typeahead">
我用下面的代碼
https://gist.github.com/1866577
謝謝。
可能重複:http://stackoverflow.com/q/11346251/484072 – peacemaker 2012-07-09 19:48:18