I have a string in my Visualforce code like so:
String strGood = ''; strGood = item.getGoodPercentage().toPlainString();
I would like to javascript encode the string. I understand that there is the JSENCODE method that can be used on the page itself, but is there an equivalent that can be used in the Visualforce class? If not what is the best approach?