I have the following line in my js file.
$( '#currency' ).html( '$' );
Do I still need to escape the "$" string? Anyway, what is the safest way to output a dollar sign?
As its says in JQuery docs:
Unlike the .html() method, .text() can be used in both XML and HTML documents. The result of the .text() method is a string containing the combined text of all matched elements. (Due to variations in the HTML parsers in different browsers, the text returned may vary in newlines and other white space.)
The .text() method cannot be used on form inputs or scripts. To set or get the text value of input or textarea elements, use the .val() method. To get the value of a script element, use the .html() method.
so if u just want to output a dollar sign, .text() would be safe as its value would be parsed as string...