【发布时间】:2013-05-15 17:48:04
【问题描述】:
我正在使用typeahead.js。我正在使用预取选项,需要解析返回的数据。它没有抛出错误;它没有做任何事情。我已经查找了示例,但没有一个使用 Prefetch Filter 选项。
Link to the prefetch documentation
我的代码(不起作用但不会引发错误):
$('#autocomplete').typeahead('destroy').typeahead( {
name: 'organizations',
prefetch: {
url: 'jsoncall',
filter: function() {
// Blatant hardcoded return value
return ['test-a','test-b','test'c];
}
}
}
);
我的 HTML:
<input id="autocomplete" class="large-12" autocomplete="off" type="text" placeholder="Enter school name">
我的困惑:
0________0
【问题讨论】:
标签: javascript jquery autocomplete typeahead.js