----- Original Message ----- From: "Mohammed Tlais" <[EMAIL PROTECTED]>
To: "Tim Nash" <[EMAIL PROTECTED]>
Cc: <zope@zope.org>
Sent: Wednesday, July 18, 2007 1:32 AM
Subject: Re: [Zope] does zope support java script

Thank you Tim, thank you Andreas, thanks for all. You gave me valuable

I figured out that the small browser inside ZMI has a problem with
javascripts, it can't display them. But, when I visit the URL of the page
from IE, the javascripts are executed normally. Am I right that ZMI can't
displays JS ? and is there a solution for it.

I use two different methods for incorporating js into my routines:

1- For js code which is used by several routines:

I create a dtml method with a name like 'popup.js' and then put the js code into the dtml method (nothing in this method except js code). I then include the js code into the target routine (another dtml method) using something like:

<script src="popup.js" language="JavaScript" type="text/javascript"></script>
The js popup routine can then be called from anywhere within this dtml method

2- For js code that is used by only one rotuine, I include it directly in the target routine (a dtml method) as follows:

<dtml-var HeaderFrame2>
<script type="text/javascript">
   alert('Password Changed');
   location.href = '<dtml-var nextRoutine>';
<dtml-var FooterFrame2>

In both of the above cases, the js code is 'readable/editable' via the ZMI (just the same as the dtml code is). Note: the js code can be edited via the ZMI, but will not be executed unless you click on the 'View' tab of the dtml method that contains the js code.

Zope works very well with js and can add significant flexibility and functionality to your applications.


Zope maillist  -  Zope@zope.org
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )

Reply via email to