On Thursday 01 October 2009 21:56:30 Mike Rumble wrote:
> You could also encapsulate this in a function wrapping Element#remove,
> which IMHO is something Prototype should do out of the box.

Quite disagree:

* If I remove an element and add it elsewhere, I don't expect its events to 
have been de-registered. The code that moves the element shouldn't have to be 
aware of the (possibly unrelated) code that added the event listeners in order 
to ask it to add them again.

* Removing from the document is not the same as allowing to be GC'd

* Some elements may never be added to the document. Eg, an XML document which 
you download, manipulate then build some HTML representation of. Perhaps you 
want to monitor for mutations and keep the HTML in sync? [1]


[1] Not actually possible in IE or Chrome/Safari but would be nice if it were. 
In Chrome DOM mutation events only fire if the element is in the document:

my wiki ajaxification thing: http://wikizzle.org
my blog: http://jimhigson.blogspot.com/

You received this message because you are subscribed to the Google Groups 
"Prototype: Core" group.
To post to this group, send email to prototype-core@googlegroups.com
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to