You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Matthias Wessendorf <ma...@apache.org> on 2008/08/20 17:59:33 UTC

util to escape JavaScript ?

Hi,

do we have a util (in one of our many subprojects) to escape strings,
that may be send down to the client as JavaScript?
I am thinking about "funny" side effects, that come up, when a user
provides something like "isn't" instead of "isn\'t".

Thanks,
Matthias

-- 
Matthias Wessendorf

Need JSF and Web 2.0?
http://code.google.com/p/facesgoodies

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org

Re: util to escape JavaScript ?

Posted by Matthias Wessendorf <ma...@apache.org>.
On Wed, Aug 20, 2008 at 5:59 PM, Matthias Wessendorf <ma...@apache.org> wrote:
> Hi,
>
> do we have a util (in one of our many subprojects) to escape strings,
> that may be send down to the client as JavaScript?
> I am thinking about "funny" side effects, that come up, when a user
> provides something like "isn't" instead of "isn\'t".
>
Yeah, google always refreshes my memory :-)
http://commons.apache.org/lang/api/org/apache/commons/lang/StringEscapeUtils.html#escapeJavaScript(java.lang.String)

-M

> Thanks,
> Matthias
>
> --
> Matthias Wessendorf
>
> Need JSF and Web 2.0?
> http://code.google.com/p/facesgoodies
>
> further stuff:
> blog: http://matthiaswessendorf.wordpress.com/
> sessions: http://www.slideshare.net/mwessendorf
> mail: matzew-at-apache-dot-org
>



-- 
Matthias Wessendorf

Need JSF and Web 2.0?
http://code.google.com/p/facesgoodies

further stuff:
blog: http://matthiaswessendorf.wordpress.com/
sessions: http://www.slideshare.net/mwessendorf
mail: matzew-at-apache-dot-org