-
-
Save jesperronn/fc05bc6dbcd7f4badbe2 to your computer and use it in GitHub Desktop.
Example for http://twitter.github.io/typeahead.js/examples/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="remote"> | |
<input class="typeahead" type="text" placeholder="Oscar winners for Best Picture"> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bestPictures = new Bloodhound({ | |
datumTokenizer: Bloodhound.tokenizers.obj.whitespace('value'), | |
queryTokenizer: Bloodhound.tokenizers.whitespace, | |
prefetch: '../data/films/post_1960.json' | |
}); | |
$('#remote .typeahead').typeahead(null, { | |
name: 'best-pictures', | |
display: 'value', | |
source: bestPictures | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created this as an issue on twitter/typeahead.js#1404