[Zope] question: javascript in zpt?

Chris Meyers chris@hddesign.com
Wed, 12 Jun 2002 12:42:33 -0500


On Wed, Jun 12, 2002 at 05:45:28PM +0200, Roel Van den Bergh wrote:
> I have a nice javascript that renders the time
> works fine in dtml
> How can I use this in zpt pages ?
> 
> For whom it might want to use it the javascript is attached
> 
> TIA, R.

Do you mean that your javascript is in its own object (zpt or DTMLMethod or file etc) and you want it as part of your zpt? If so then you can just use something like:

<span tal:replace="structure here/path/to/javascript">javascript</span>

or like this if you don't like spans hanging around

<tal:x replace="structure here/path/to/javascript">javascript</tal:x>

The key to this is including "structure" in your tal:replace statement. This lets the parser know that it shouldn't display your javascript code.

HTH
Chris Meyers