Using Bootstrap\'s typeahead javascript plugin, I\'m attempting to change the data-source attribute via jQuery\'s $.post method. Initially, I have:
I eventually figured out how to do this. It is outlined on github here.
Access the typeahead input's data attribute and modify the source array directly. E.g:
var autocomplete = $('input').typeahead(); //where newSource is your own array autocomplete.data('typeahead').source = newSource;