You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by pmcdaid <pm...@nortel.com> on 2008/10/21 17:00:33 UTC

single quotes causes problems when passed into javascript from properties file

I'm working on sipxecs project and we're using Tapestry 4.1.5. We have an
issue where any items using single quotes in .properties files that is
passed as a string parameter to a javascript is not interpreted properly.

i.e.

confirm.delete=don't delete this line

I've tried:
confirm.delete=don\'t delete this line
which doesn't work.

I've also tried:
confirm.delete=don\u005c't delete this line
which works, but we don't want to impose this on .properties writers. 

I've put in a workaround where I do a StringEscapeUtils.escapeJavaScript()
on the string parameter.

Is there any other way of doing this other than the above?

Thanks,
Paul.
-- 
View this message in context: http://www.nabble.com/single-quotes-causes-problems-when-passed-into-javascript-from-properties-file-tp20092178p20092178.html
Sent from the Tapestry - Dev mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org


Re: single quotes causes problems when passed into javascript from properties file

Posted by Andreas Andreou <an...@gmail.com>.
Hi, this is a question for the users list, so please ask there...

Also provide some example on how you're passing that string to javascipt

On Tue, Oct 21, 2008 at 6:00 PM, pmcdaid <pm...@nortel.com> wrote:
>
> I'm working on sipxecs project and we're using Tapestry 4.1.5. We have an
> issue where any items using single quotes in .properties files that is
> passed as a string parameter to a javascript is not interpreted properly.
>
> i.e.
>
> confirm.delete=don't delete this line
>
> I've tried:
> confirm.delete=don\'t delete this line
> which doesn't work.
>
> I've also tried:
> confirm.delete=don\u005c't delete this line
> which works, but we don't want to impose this on .properties writers.
>
> I've put in a workaround where I do a StringEscapeUtils.escapeJavaScript()
> on the string parameter.
>
> Is there any other way of doing this other than the above?
>
> Thanks,
> Paul.
> --
> View this message in context: http://www.nabble.com/single-quotes-causes-problems-when-passed-into-javascript-from-properties-file-tp20092178p20092178.html
> Sent from the Tapestry - Dev mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>



-- 
Andreas Andreou - andyhot@apache.org - http://blog.andyhot.gr
Tapestry / Tacos developer
Open Source / JEE Consulting

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org