I’m having troubles with some string chars like 'c++', when trying manipulating that i receive an error: uncaught exception: Syntax error, unrecognized expression: +
Is there some way of declaring strings or somenthing more that can be usefull to this case?
In this case i pass var k = 'c++' to a function which prints that var in this way:
$('#wrapper').html('<span>'+k+'</span>');
Are you eval’ing the above code? As it stands what you have there works fine if it’s just included in a page with var k = “c++”.
If you are going to eval the string, then you should surround ‘k’ with quotes and also escape any quotes that might be in it.