Ad code in xslt template
This is an open discussion with 2 replies, filed under General.
Search
Talking about XSL output, you can recreate comments with
<xsl:comment>commented text</xsl:comment>
, having all the other tags written as they are, e.g. < /script>
.
This one worked for me:
< script type="text/javascript"> <xsl:comment> window.alert('hey'); //</xsl:comment> < /script>
(Delete those whitespaces in script tag)
If you have issues with entities like quotes, add them into DOCTYPE as entities, but single or double quotes always worked for me out of the box, so far.
Hope I helped somehow.
For external scripts, I like to just wrap their JavaScript inside CDATA. This way its still legible when you're constructing your site.
Create an account or sign in to comment.
I have this code
<!-- YB: header (728x90) --> <script type="text/javascript"><!-- yieldbuild_site = 1234; yieldbuild_loc = "header"; //--></script> <script type="text/javascript" src="http://hook.yieldbuild.com/s_ad.js"></script>
The problem is that it it not displaying ads I think because of the comments in the script tag. I tried to remove them but the same. Any idea how to get it working ?