Skip to content

SyntaxError when filling in a '[' in the typeahead text box #3

@ikkentim

Description

@ikkentim

SyntaxError when filling in a '[' in the typeahead text box

Error details:
bootstrap-typeahead.js:147
SyntaxError: Invalid regular expression: missing terminating ] for character class

Fill in, for example '[tng'

My code:
$('#search').typeahead({
source:function (typeahead, query) {
if($('#search').val().length < 3)
return;

        $.getJSON('/players/get/' + $('#search').val(), function (data) {
            if (data == null)
                return;

            var items = [];
            for (var i in data['options']) {
                items.push(data['options'][i]);
            }
            typeahead.process(items);
        });
    }
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions