[Zope] javascript vars in dtml

Sascha Welter zopelist at betabug.ch
Sat Feb 26 05:08:24 EST 2005


(Fri, Feb 25, 2005 at 12:00:07PM -0500) "Jonathan Hobbs" <toolkit at magma.ca>
wrote/schrieb/egrapse:
> But, in the case where you want javascript to process user entered data, or
> to provide additional information based on some user action, you have two
> options (that i can think of, there are probably more!):
> 
> 1) have javascript create additional 'form' fields containing the info you
> want passed back to dtml/scripts (said form fields can then be processed as
> usual)
> 
> 2) create a hidden iframe in your html page; use javascript to reload this
> page by building a url (with data parameters) which invokes a dtml/script
> routine.  The dtml/script can process the parameters passed in the url and
> then pass whatever you want back to the client  where your javascript can
> then interpret the response from the dtml/script.  This is a nice way of
> communicating between the client and your zope site without the user seeing
> page reloads.

Or, as I've seen lately in a weird example, you can use JavaScript to
write some value into a cookie and use something from within Zope to
read that cookie value. Not saying that it would make sense everywhere.

Regards,

Sascha



More information about the Zope mailing list