Last active
May 31, 2020 09:19
-
-
Save jharding/9458772 to your computer and use it in GitHub Desktop.
Example for http://twitter.github.io/typeahead.js/examples/.
This file contains 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 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: { | |
url: '../data/films/queries/%QUERY.json', | |
wildcard: '%QUERY' | |
} | |
}); | |
$('#remote .typeahead').typeahead(null, { | |
name: 'best-pictures', | |
display: 'value', | |
source: bestPictures | |
}); |
For a local json, what should be the url for remote?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
thanks works perfect on laravel 5.4