Something strange is occurring and I'm stumped.
I have a link that looks basically like this:
<a href="javascript:uploadVariantPicture('size:'test2'');">Link</a>
As you can see, I'm calling function uploadVariantPicture with parameter "size:'test2'".
However, when I actually click the link, JavaScript complains that the two encoded single quotes aren't being escaped. I'm getting the following error:
SyntaxError: Unexpected identifier 'test2'. Expected ')' to end an argument list.
If I decode the two encoded single quotes and escape them using a backslash, then the function call succeeds. But the problem is I need it encoded. I cannot leave it unencoded and escape the quotes. This won't work for my situation.
Any help is greatly appreciated. I'm super confused.