Skip to content Skip to sidebar Skip to footer

Javascript Templates

Does anyone know if is there any way to create javascrit templates in Genshi? I mean, I need a .js file where I can use directives like and so. Any idea? Thanks!

Solution 1:

You can write it directly in html like this:

<scripttype="text/javascript">
<py:if test="func1">
/*&lt;![CDATA[*/functionfunc1() {
      }
/*]]&gt;*/
</py:if>
</script>

note: code inside CDATA will be right escaped, so you can use '>','<' as usual.

Post a Comment for "Javascript Templates"