Niko Niko - 4 months ago 11
jQuery Question

jquery doesn't work with string variables

is this a bug or expected? (google Chrome Screenshot)

When I use the hard-coded String, it works, but when I use the same string in a variable, it doesn't. I'm using JSF if this is relevant somehow.

enter image description here

Answer

The variable contains a string with two backslashes in it, but when you type out the string yourself, you're typing a string with only one backslash in it. (Typing \\ in a quoted string results in one \, since the backslash is an escape character.)