[Zope] dtml-lesson learned... (DTML v ZPT)
Andreas Kostyrka
andreas@kostyrka.priv.at
30 Aug 2002 21:33:15 +0200
Am Mit, 2002-08-21 um 17.16 schrieb Mike Renfro:
> On Wed, Aug 21, 2002 at 10:06:46AM +0800, Tim Hoffman wrote:
>
> > I find with pagetemplates that if you have large chunks of
> > Javascript, that need to be dynamically modified that pagetemplates
> > requirement to validate the page becomes a pain. You get situations
> > within Javascript where to get the page to compile, you have to do
> > really ugly hacks, which quickly become even more unreadable than
> > dtml
>
> Out of curiosity, is this pain at all reduced if you put the
> Javascript in some other page and refer to it from your templates? Or
> is Javascript not similar enough to valid xml in general?
Nope it is not. As most programming languages are ;)
But the solution is quite easy. Stuff your dynamic Javascript into a
DTML Method, and include it from the page template.
Andreas