jquery - Unrecognized expression when using special ID -
i have following code in jquery mobile 1.2 project. working fine until upgraded jquery 1.7.2 jquery 1.8.3.
<input type="text" id="a['val']" name="a['val']" />
when page loaded, throws
syntax error, unrecognized expression: label[for='a['val']']
and page refuse load. although there's no label in code, error thrown asking label. problem occurs in jquery 1.8 , it's working fine 1.9 , versions prior 1.8.
i think bug or feature in jquery 1.8 + jqm 1.2, occurs when have id containing '
jquery can't transfer selector of label correctly , throw error, can modify id "a[val]"
or 'a["val"]'
, it's ok.
<input type="text" id='a["val"]' name="a['val']" />
see fiddle
Comments
Post a Comment