See this old thread: 
http://www.nabble.com/RenderSupport-addScript-old-browsers-td23039476.html

----- Original Message -----
From: "Peter Stavrinides" <p.stavrini...@albourne.com>
To: "Tapestry users" <users@tapestry.apache.org>
Sent: Tuesday, 5 May, 2009 16:36:14 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: t5: embed a variable in a javascript in a tml?

>Why not just do:
><script language="JavaScript" type="text/javascript">
>var google_conversion_id = ${myid};

Are you being serious?

The html comment "<!--" is used supposedly to prevent scripts being read by 
browsers too old to understand them, though there are no browsers that old in 
operation any more. If you place your assignment outside the comment, why have 
the comment in the first place? Also consider the irony that HTML comments used 
in script blocks were included to prevent breaking older browsers, but 
including them in xhtml documents may just break the newest browsers or future 
browsers.

Peter 


-- 
If you are not an intended recipient of this e-mail, please notify the sender, 
delete it and do not read, act upon, print, disclose, copy, retain or 
redistribute it. Please visit http://www.albourne.com/email.html for important 
additional terms relating to this e-mail.

----- Original Message -----
From: "roubaozi" <lagjazz.j...@gmail.com>
To: users@tapestry.apache.org
Sent: Tuesday, 5 May, 2009 16:18:44 GMT +02:00 Athens, Beirut, Bucharest, 
Istanbul
Subject: Re: t5: embed a variable in a javascript in a tml?


Why not just do:
<script language="JavaScript" type="text/javascript">
var google_conversion_id = ${myid};
<!--
var google_conversion_language = "en_US";
var google_conversion_format = "3";
var google_conversion_color = "ffffff"
//-->
</script>



Angelo Chen wrote:
> 
> Hi,
> 
> I'd like to get myid from the page,  but following code will not work, the
> line:
> 
> var google_conversion_id = "${myid}"
> 
> will be rendered as it is, it is not as what I expected
> 
> var google_conversion_id = "12345678"
> 
> any idea how to embed a variable in a javascript in the template? thanks
> 
> Anelo
> 
> 
> <script language="JavaScript" type="text/javascript">
> <!--
> var google_conversion_id = ${myid}
> var google_conversion_language = "en_US";
> var google_conversion_format = "3";
> var google_conversion_color = "ffffff"
> //-->
> </script>
> 

-- 
View this message in context: 
http://www.nabble.com/t5%3A-embed-a-variable-in-a-javascript-in-a-tml--tp23382334p23387274.html
Sent from the Tapestry - User mailing list archive at Nabble.com.


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


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


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

Reply via email to