Invoking JavaScript event handler in Internet Explorer by python/win32com

Andrew Clover and-google at doxdesk.com
Tue Mar 4 13:32:10 CET 2003


Florian Fredegar Haftmann <fredegar at haftmann-online.de> wrote:

> When my own handler is finished, he is supposed to call the old
> "native" handler. But how is that to be done?

Have you tried using the IE DOM methods attachEvent and detachEvent?

http://msdn.microsoft.com/workshop/author/dhtml/reference/methods/attachevent.asp

This implements an event interface where multiple event handlers can
listen for the same event. Somewhat similar to the W3C DOM Level 2
Events interface, but IE's non-standard version.

> If the old event handler is stored in self.oldevt, a call
> self.oldevt() only returns a textual representation

In the normal IE DOM, the onclick attribute is a function, not
a string, so you would indeed call it with a simple (). Don't know
why you might be getting a string, if that's what's happening.

-- 
Andrew Clover
mailto:and at doxdesk.com
http://www.doxdesk.com/




More information about the Python-list mailing list