DBJ,
Mutation events are supported in FF (as of v2, I believe), despite
what that table had said.
https://developer.mozilla.org/En/DOM_Client_Object_Cross-Reference/DOM_Events
And you can bind with the normal bind.
jQuery('.container').bind('DOMSubtreeModified',function(e){
console.log(this,arguments);
})
As these events aren't supported in IE, I'd consider the overhead to
retro-fit support to be too great.
Here's a good resource on this, essentially a jQuery plugin that
normalizes support:
http://tobiasz123.wordpress.com/2009/01/19/utilizing-mutation-events-for-automatic-and-persistent-event-attaching/
With some cleanup, I'd think that (being a plugin) is the right place
for Mutation event support to reside.
Paul
On Dec 16, 8:40 am, DBJDBJ <[email protected]> wrote:
> CHROME supports this ... but FF does not. same as IE8
> .http://www.w3.org/2003/02/06-dom-support.html
>
> jQuery 1.5 perhaps ?
>
> What I am actually talking is jQuery implementing support for
> "Mutation Events" , which is DOM Level 2
> ...http://www.w3.org/TR/2000/REC-DOM-Level-2-Events-20001113/events.html...
> Mutation Events are actualy consequences of CRUDE operations on the
> dom tree ...
> This would allow $("div) that $("div").find(".subset").remove() has
> happened.
>
> For example :
>
> var d1 = $("div") ; // .length === 10
> // d1 is made by you
>
> var d2 = $("div.foo") ; // subset of div's , length === 3
> // imagine d2 was made inside some plugin out of your control, but on
> the same page
> d2.remove() ;
>
> d1.length === 7 // because mutation event was fired (by dom itself)
> and d1 "knows" what was removed
>
> // optionaly one can could "get" the clones of removed nodes, if "one"
> has subscribed to a Mutation Event
> jQuery.subscribeToMutation( "REMOVE" , function ( mutation_event )
> { /* receive a mutation event upon removal of any dom node */});
>
> Would this be just nice ?
> Although I can see difficulties for this working in IE6 ;o)
>
> --DBJ
--
You received this message because you are subscribed to the Google Groups
"jQuery Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jquery-dev?hl=en.