You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Borut BolĨina <bo...@gmail.com> on 2009/04/14 15:27:37 UTC
RenderSupport addScript old browsers
Hi,
how "safe" is using addScript method of the RenderSupportĀ considering
old browsers support? Tapestry renders something like:
<script type="text/javascript">
<!--
Tapestry.DEBUG_ENABLED = true;
Tapestry.onDOMLoaded(function() {
urchinTracker();
var pp_gemius_identifier = new
String('dw.rQgdz5MHhw1_2bpPIltTI.IjBDjCvnQC0f_bLGdj.v7');
});
// -->
</script>
when using
@AfterRender
public void afterRender() {
renderSupport.addScript("urchinTracker();");
renderSupport.addScript("var pp_gemius_identifier = new
String('dw.rQgdz5MHhw1_2bpPIltTI.IjBDjCvnQC0f_bLGdj.v7');");
}
As per http://javascript.about.com/library/blxhtml.htm there are
several possibilities on how to deal with old browsers.
If any JS expert is reading this, how does the code bellow differ from
what Tapestry renders as shown above? The difference is in the
comments and CDATA.
<script type="text/javascript">
<!--//--><![CDATA[//><!--
var pp_gemius_identifier = new
String('dw.rQgdz5MHhw1_2bpPIltTI.IjBDjCvnQC0f_bLGdj.v7');
//--><!]]>
</script>
Regards,
Borut
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org