[Zope] Re: Best Practice for including Javascript in Zope
Applications
Tres Seaver
tseaver at palladion.com
Tue Jan 1 21:16:21 EST 2008
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Matt Hollingsworth wrote:
> I'm new to developing for zope, and I have a quick question regarding some
> best practices when using Javascript in zope applications.
>
>
> I would like to use Ext JS (http://www.extjs.com/ ) in an application that I
> am writing. It is a fairly extensive library, so I didn't really want to
> copy/paste every single file into a dtml method. I looked all over the
> place for some discussion on this subject, but only found things relating to
> plone (which apparently has a javascript registry); however, I wish to stay
> away from plone for this particular application.
>
> What should I do to use these libraries? Is there a canned solution for
> this sort of thing?
The simplest route:
- Create a "File" object in the ZMI for each separate javascript
library (e.g., 'extlibrary.js').
- Upload the static content of the library file to that object.
- Include a link to the JS library in your master page template,
e.g.::
<script type="text/javascript" src="/extlibrary.js" />
Tres.
- --
===================================================================
Tres Seaver +1 540-429-0999 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHevP1+gerLs4ltQ4RAvjPAJ9DzvRiALdpBCJWmgk/Iy5NE+WTgACfSwkP
GpI0Nt2CC08qn7o4B+e/xcw=
=dijk
-----END PGP SIGNATURE-----
More information about the Zope
mailing list