Re: Finding events on a page added using addEventListener

Boris Zbarsky <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Jon wrote:
> document.addEventListener(
>     "DOMNodeInserted",
>     function(e) { catcher(e.target); },
>     false
> );

Don't you also need to do this with the descendants of e.target?

> I think its triggered if an element is moved around the DOM so that means
> catcher() will be called multiple times on a node and so
> addEventListenerOld will recursively call itself when an event is
> added.

Yes.  You need to handle that.

-Boris
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.