[Zope] Re: Best Practice for including Javascript in Zope Applications

Andreas Jung lists at zopyx.com
Wed Jan 2 00:18:10 EST 2008



--On 2. Januar 2008 06:16:06 +0100 Andreas Jung <lists at zopyx.com> wrote:

>
>
> --On 1. Januar 2008 21:16:21 -0500 Tres Seaver <tseaver at palladion.com>
> wrote:
>
>
>>>
>>> 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" />
>>
>
> Larger JS frameworks like Dojo tend to be split across several files and
> directories. The fun starts when such frameworks load/reload stuff
> using relative URLs. A co-worker using Dojo intensively had to invest
> some time in order to integrate such a JS monster properly. As far as I
> remember Extjs also uses multiple files (but not as much as Dojo
> does)..so please check in advance.
>
Another point: consider using CMF and putting your library files into a
directory system view on the filesystem. This makes your life much easier.

-aj
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 186 bytes
Desc: not available
Url : http://mail.zope.org/pipermail/zope/attachments/20080102/16394c6c/attachment.bin


More information about the Zope mailing list