所以我现在有一个使用Twitter的typeahead.js的表单。我正在考虑在使用它的页面上添加一个重复的表单,但我意识到一个更好的解决方案是只有一个表单,用逗号分隔,就像google的ngram search (https://books.google.com/ngrams)一样。
我想知道当typeahead.js到达表单中的逗号时,是否有一种方法可以重新启动它自己?
作为参考,下面是我的脚本,它包含了当前的typeahead:
<script type="text/javascript">
$(document).ready(function() {
$("#navPersonSearch").typeahead({
name: 'people',
remote: '/name_autocomplete/?q=%QUERY',
minLength: 3
})
.keydown(function(e) {
if (e.keyCode === 13) {
$("form").trigger('submit');
}
});
});
</script>发布于 2013-10-25 11:43:26
我查了一下,我猜它不会被支持:https://github.com/twitter/typeahead.js/issues/134
https://stackoverflow.com/questions/19580550
复制相似问题