Reputation: 881
I am trying to set up twitter typeahead in my application.
http://twitter.github.io/typeahead.js/examples/
Howevery, I don't get this thing to work. I have included the js file and have this as my input
<input id="hashtag_search" name="s" type="text" class="form-control typeahead tt-query tt-hint" placeholder="#hashtag" autocomplete="off" dir="auto">
and this as my JS:
$("#hashtag_search").typeahead({
name: 's',
local: ['timtrueman', 'JakeHarding', 'vskarich']
});
Can anyone help? Would be great.
Thanks!
EDIT: Now I am getting this as an output:
Upvotes: 1
Views: 3046
Reputation: 342
it didn't work for me either until i put your JS inside $(document).ready(); block
Upvotes: 4