I have an MVC app where I'm inserting some text into the DOM using jQuery.
If I use:
$("#toggle").text('<%: translated.Show %>');
The text is rendered.
If I use:
$("#toggle").text("<%: translated.Show %>");
Where resource string is wrapping in double quotes it throws a JavaScript error, note the single quotes wrapping the working version and double quotes wrapping the erroneous version.
Can anyone explain why, I thought there was little difference between single and double quotes in Javascript.
The 'translated.Show' string does not contain quotes just plain text.