I do not know if there is a solution for this, but maybe somebody figured it out. Here is the problem:
I have to dynamically add an indeterminate images to a page.
For each image I add an event listener with the DOM function attachEvent.
The problem is that attachEvent (or its equivalent in Firefox) only allows the specification of a function, not its parameters. For example
img.attachEvent('onclick',myfunction);
When the event fires, there is no way to find out from which image it fired. The 'this' object will point to the window, not to the image from which it fired.
It looks like it is impossible to dynamically add events that would detect their target object.
Or is it possible?
Mike



Reply With Quote

Bookmarks