Skip to content

id attribute values are not escaped before being used as jquery selectors #163

Closed
@dominicgamble

Description

@dominicgamble

Affected: selectmenu_v1.1.0-11 and all previous versions.

See: http://docs.jquery.com/Frequently_Asked_Questions#How_do_I_select_an_element_by_an_ID_that_has_characters_used_in_CSS_notation.3F

"Because jQuery uses CSS syntax for selecting elements, some characters are interpreted as CSS notation. For example, ID attributes, after an initial letter (a-z or A-Z), may also use periods and colons, in addition to letters, numbers, hyphens, and underscores (see W3C Basic HTML Data Types). The colon (":") and period (".") are problematic within the context of a jQuery selector because they indicate a pseudo-class and class, respectively.

In order to tell jQuery to treat these characters literally rather than as CSS notation, they must be "escaped" by placing two backslashes in front of them."

On line 41, and line 413 id attribute values are used to generate jquery selectors, and in my case if the id contains a colon (:) then it causes an exception within jquery when trying to use it as a selector. Escaping the colon with a double slash () fixes the problem.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions