RE: [Zope] How to access html-objects in DTML or python
[Wim Bekker]
How to access html-objects in DTML or python?
With JavaScript I can access objects, like the table-data with obj=document.getElementById(id) (and have something like <td id="RC1_1">). Then I can change its attributes like obj.bgColor=#FFFFFF. But herefore, I have to enable JavaScript.
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, and then use Javascript to interact between that frame and the parent page. I doubt that this is what you have in mind, though. (There are browser-specific techniques that you can sometimes use too). Cheers, Tom P
participants (1)
-
Passin, Tom