[Zope] How to access html-objects in DTML or python
Fri, 23 May 2003 10:55:25 -0400
> How to access html-objects in DTML or python?
> obj=3Ddocument.getElementById(id) (and have something like <td=20
> Then I can change its attributes like obj.bgColor=3D#FFFFFF.=20
> But herefore, I
First, you have to use the right mental model. When you are creating a
page with Zope, there are no "html-objects" to access. They will not
exist until the browser displays the page. By this time, Zope has no
connection with the page anymore.
If you want something to happen in the browser, you will have to write
the scripting code to do in _in the browser_. You can have Zope put
that code on the page, but Zope cannot interact with the page.
The closest you can come to simulating an interaction with Zope is by
using another frame. This could be an Iframe embedded in the main page
and made invisible by styling. You can load a new page into the frame,
page. I doubt that this is what you have in mind, though.
(There are browser-specific techniques that you can sometimes use too).