[Zope] DTML html_quoting my JavaScript

Jonathan Hobbs toolkit at magma.ca
Mon Feb 21 07:47:34 EST 2005


From: "Andrew Maclean" <andyjmaclean at hotmail.com>
> I've got myself into a problem with DTML.  The system I've been working on
> uses a lot of JavaScript, which is stored in DTML methods.  After 14
months
> of development, I have been asked to reproduce the installation on another
> machine, where, unlike the original installation, all my <dtml-variables>
> are html_quoted, rendering them useless.
>
> According to the Zope book, <dtml-vars> are always html_quoted.  I know
this
> is not the case because for over a year I could successfully store
> JavaScripts in DTML methods.  Then there is no html_unquote function.
>
> I have considered just moving the data.fs file to the new installation but
I
> don't want to do that because
>
> 1) I want to know why this problem arose
>
> and
>
> 2) It's future dated, so I can't pack this database without changing the
> system time to a future date.  (if anyone knows how the date of the
data.fs
> can be modified please let me know)
>
> I doubt I'm the first to use DTML to store JavaScript, so if anyone out
> there knows how to stop it systematically wrecking the code, could you
> please please please send me some advise.  Thanks,

We use a lot of javascript in our systems, but we have never used dtml-var
to display the javascript (we just type the javascript into the dtml method
without using any dtml tags), example

<dtml-var standard_html_header>
<script>
your js here
</script>
<dtml-var standard_html_footer>

You don't need to dtml-var your js code, it will be ignored by zope and
passed 'as-is' to the client browser.

What do you mean by 'use DTML to store JavaScript'?  Are you saving js code
in property fields of zope objects or something else?

Jonathan




More information about the Zope mailing list