jQuery's uses this code to detect an id based selector :
characterEncoding = "(?:\\.|[\w-]|[^\x00-\xa0])+"
...
"ID": new RegExp( "^#(" + characterEncoding + ")" ),
This regex fails for "''''''""""'''''''''''''"#####$'''''"
or more simply for "'"
.
The query engine is limited, which isn't very surprising for a so concise language and id validity rules so lax. it can't handle any valid id.
If you really need to be able to handle any kind of valid id, use
$(document.getElementById(jsonTest[0].myId))
In fact, you should never use $('#'+id)
as it simply adds a useless (and a little dangerous) layer of parsing for the same operation.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…