Twitter's typeahead + Bloodhound with JSON objects
问题 I can't get it to work with JSON objects. I've followed multiple questions here on SO and none of the answers helped me. $(function() { var items = new Bloodhound({ datumTokenizer: Bloodhound.tokenizers.obj.whitespace('name'), queryTokenizer: Bloodhound.tokenizers.whitespace, limit: 10, prefetch: { url: 'items.json', filter: function(list) { return $.map(list, function(item) { return { name: item.name, category: item.category, release: item.release, id: item.id }; }); } } }); items.initialize