> I still had to do the escaping of the quotation marks myself

Take a look at JSONObject.quote(String string);


On Wed, Jul 14, 2010 at 10:40 AM, Tim Koop <t...@timkoop.com> wrote:
>  Cool!  It works!
>
> I still had to do the escaping of the quotation marks myself, but at least
> the html encoding doesn't need to be undone first.
>
>
>
> (Now if only there was outputjsstring, outputurl, outputtextarea, outputcsv,
> and outputcustom)
>
>
> Tim Koop
> t...@timkoop.com <mailto:t...@timkoop.com>
> www.timkoop.com <http://www.timkoop.com>
>
> On 14/07/2010 12:30 PM, Michael Gentry wrote:
>>
>> Assuming your example is in your TML file, try:
>>
>> var name='<t:outputraw value="name"/>';
>>
>> mrg
>>
>>
>> On Wed, Jul 14, 2010 at 1:27 PM, Tim Koop<t...@timkoop.com>  wrote:
>>>
>>>  Hi everyone.
>>>
>>> I've looked through the documentation, but I can't seem to find an answer
>>> for what I'm looking for.
>>>
>>> I want to put a String into Javascript as a variable, like this:
>>>
>>> <script>
>>> var name = "${name}";
>>> </script>
>>>
>>> The problem is that if the name will have a quotation mark in it, it
>>> won't
>>> be escaped, and if it has angle brackets, they will be escaped.  So a
>>> name
>>> like: /This->"One"/ will create a variable that looks like this:
>>>
>>> <script>
>>> var name = "This-&gt;"One"";
>>> </script>
>>>
>>> There must be a simple answer for this, but I haven't found it.
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>> --
>>> Tim Koop
>>> t...@timkoop.com<mailto:t...@timkoop.com>
>>> www.timkoop.com<http://www.timkoop.com>
>>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
>> For additional commands, e-mail: users-h...@tapestry.apache.org
>>
>>
>



-- 
--
http://www.bodylabgym.com - a private, by appointment only, one-on-one
health and fitness facility.
--
http://www.ectransition.com - Quality Electronic Cigarettes at a
reasonable price!
--
TheDailyTube.com. Sign up and get the best new videos on the internet
delivered fresh to your inbox.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to