Hi Stephen,
At the freemarker level there is the simple ${productName?js_string}
instruction.
Freemarker has a lot of these kind of buil-in string utilities :
http://freemarker.sourceforge.net/docs/ref_builtins_string.htmlRegards
2009/11/16 Stephen Rufle <
[hidden email]>
> I found a solution
> productName =
> org.apache.commons.lang.StringEscapeUtils.escapeJavaScript(productName)
>
> ftl version
> <#assign productNameJsEscaped =
> Static["org.apache.commons.lang.StringEscapeUtils"].escapeJavaScript(productName)/>
>
>
>
> Stephen Rufle wrote:
>
>> Is there a utility function that would turn "4'Widgit" into "4\'Widgit"? I
>> am passing a product name through javascript and the fact that there is a
>> single quote "'" is causing an error on the page.
>>
>>
>>
>>
>>
>
>