我正在尝试在我的应用程序中设置twitter typeahead。
http://twitter.github.io/typeahead.js/examples/
但是,我没有把这件事搞定。我已经包含了js文件并将其作为我的输入
<input id="hashtag_search" name="s" type="text" class="form-control typeahead tt-query tt-hint" placeholder="#hashtag" autocomplete="off" dir="auto">
这是我的JS:
$("#hashtag_search").typeahead({
name: 's',
local: ['timtrueman', 'JakeHarding', 'vskarich']
});
有人可以帮忙吗?会很棒。
谢谢!
编辑:现在我将此作为输出:
答案 0 :(得分:4)
直到我把你的JS放在$(document).ready()之内它才对我有效。块