I'm using jQuery Bootstrap Typeahead. I get data from my file but typeahead dropdown is not populate/shown.
Here is my JS:
(function() {
"use strict";
var $input = $('.typeahead');
$('.typeahead').typeahead({
source: function (query, process) {
return $.getJSON(
'url-to-file.php',
{ query: query },
function (data) {
console.log(data)
return process(data);
})
}
});
})();
console.log()
returns a (correct) JSON array:
[ "item1", "item2", ... ]
But I don't know what to do after. Thanks for helping