[ZPT] Re: why does tal not get interpretted inside <script> tags?

Godefroid Chapelle gotcha at bubblenet.be
Wed Sep 8 06:57:36 EDT 2004


Chris Withers wrote:

<snip>


> 
> All well and good, but my template is generating html.
> 
> *sigh*

Have you tried the following ?


     <tal:script define="first_var string:a">
     <script tal:content="string:
             alert('$first_var');
             alert('${template/getId}');
     ">
     </script>
     </tal:script>


where the tal:script is to show that a defined variable used in the 
script and where the newlines in the tal:content otf the script tag 
allow for nice output (shown hereunder)

     <script>
             alert('a');
             alert('select_widget_form');
     </script>

> 
> Chris
> 


-- 
Godefroid Chapelle (aka __gotcha)                http://bubblenet.be



More information about the ZPT mailing list