Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bootstrap Typeahead local, prefetch, or remote is required [closed]

I try to get this example of twitters typeahead to run but i am getting the error in chromes console:

Uncaught Error: one of local, prefetch, or remote is required jquery-1.9.1.js:507

I am using typeayhead 0.9.1 (Nuget-Package). Is this a version problem? All examples set the source and not local/prefetch/remote in the request.

EDIT: Turned out that Twitter Bootstrap Typeahead and Twitter Typeahead are two different libraries.

like image 298
daniel Avatar asked Apr 18 '13 17:04

daniel


People also ask

What are Bootstrap typeahead input fields?

The bootstrap typeahead input fields are very popular in modern web forms. The main cause of using typeahead is to improve the user experience by supplying hints or a list of possibilities based on the text they’ve entered while filling a form or searching (something like the Google immediate search).

What is type ahead in Bootstrap?

Creating Typeaheads with Bootstrap The typeahead input fields are very popular in modern web forms. The main purpose of using typeahead is to improve the user experience by supplying hints or a list of possible choices based on the text they've entered while filling a form or searching something — like the Google instant search.

What happened to typeaheads in Bootstrap?

Typeahead plugin has been dropped from the Bootstrap (v3.0+), in favor of using Twitter typeahead. Twitter typeaheads is a fast and fully-featured autocomplete library inspired by twitter.com's autocomplete search functionality.

How to prevent default browser menus from appearing over bootstrap type-ahead dropdown?

Tip: Set autocomplete="off" for the input box if you want to prevent default browser menus from appearing over the Bootstrap type-ahead dropdown. You can also specify external dataset through a URL pointing to a JSON file containing an array of datums.


1 Answers

This only means you need to give a list in which Typeahead will search for completion value.

You must really pass at least one data source (prefetch or remote) or a data set (local).

https://github.com/twitter/typeahead.js#jquerytypeaheaddatasets


Also, should be noted that Twitter typeahead and Twitter Bootstrap typeahead ain't the same plugin. They have different API. The article you read speak about Twitter Bootstrap typeahead: http://twitter.github.io/bootstrap/javascript.html#typeahead but you used it as Twitter typeahead!

like image 118
Simon Boudrias Avatar answered Sep 28 '22 14:09

Simon Boudrias