[ZPT] Tags not allowed inside script blocks?

Hamish Lawson hamish_lawson@yahoo.co.uk
Tue, 12 Jun 2001 20:23:54 +0100 (BST)


Fred Drake wrote:

> > Does the HTMLTALParser not like any tags being inside a script
> > block?
> 
> This is illegal HTML; <script> elements are not allowed to have
> element content.

Of course. I was forgetting that the template must itself be proper
HTML - it's not just good enough that the illegal gets removed before
the page reaches the browser.

> You can make the <script> element itself be "active", or use a
> wrapper around it that selects the appropriate script.

I want to insert the value of a template variable into a JavaScript
code block. By making the <script> element active, do you mean making
the whole content of the script be a huge multiline tal:content
attribute of the <script> tag (with appropriate embedded $
interpolators for the template variables)? This presumably also means
that any quotes in the JavaScript code would have to be encoded as HTML
&quot; entities in order not to clash with the tal:content attribute's
own quotes.

Hamish Lawson


____________________________________________________________
Do You Yahoo!?
Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
or your free @yahoo.ie address at http://mail.yahoo.ie