Skip to content

Numeric value causes TypeError #176

@gwhenne

Description

@gwhenne

I have a div like this:

<div data-i18n="10">10</div>

This results in Uncaught TypeError: messageKey.indexOf is not a function in this line in i18n:

lBracket = messageKey.indexOf( '[' );

Since messageKey is a number, not a string.

I suggest the following fix, a few lines up:

messageKey = $this.data( 'i18n' ) + '',

Thereby forcing messageKey to be a string.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions