Actually, that would have an issue if your name had a single quote in it. You might have to use a hidden form value (hopefully you have a form?). There is a bug in the Tapestry hidden component, though, so you have to do some tricks. Something like ...
<t:form t:id="inputs"> <t:hidden t:id="name" value="name"/> </t:form> Then using Prototype in your JavaScript: $('inputs')['name'].value mrg On Wed, Jul 14, 2010 at 1:30 PM, Michael Gentry <mgen...@masslight.net> 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->"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