Hy! I\'m using twitter bootstraps typeahead:
I\'m calling a page that returns a response with json_encode the page returns a name and an ID,
I want that the type
I noticed when using this code that if the match included the letters 'st', the typeahead suggestions include the style tag in the typeahead suggestions.
For example the suggested matches would show
style="padding: 10px; font-size: 1.5em;">standard
instead of
standard
I changed the replace function to this:
replace: function (string) {
return String.prototype.replace.apply(this.name, arguments);
}
Obviously you lose the additional formatting, but it doesn't break on 'st' matches (I assume it would also break on 'di', or other substrings of the div tag.