Skip to content

Instantly share code, notes, and snippets.

@jesperronn
Forked from jharding/remote.html
Created October 15, 2015 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jesperronn/fc05bc6dbcd7f4badbe2 to your computer and use it in GitHub Desktop.
Save jesperronn/fc05bc6dbcd7f4badbe2 to your computer and use it in GitHub Desktop.
<div id="remote">
<input class="typeahead" type="text" placeholder="Oscar winners for Best Picture">
</div>
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
});
@jesperronn
Copy link
Author

I created this as an issue on twitter/typeahead.js#1404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment