is there any example how to use the mutation! method?
@candera yes, many of them are irrelevant to the mutation observer, so you can attach the attribute anywhere and it doesn’t matter
Requires hoplon 7.2?
But none of those let you see when your ancestors have changed, do they?
oh ancestors no children yes
Yeah, I would think you’d need to know about ancestors to understand when you’ve been added to the DOM…
I think thats the one you are looking for, but I would need to RTM again
But that doesn’t help, does it?
I don’t think there’s a great way to always know ahead of time who your parent is going to be and have him watch for you being added. I want to put something on the node that’s outside the DOM.
You can recursievly listen to the body or whatever, but that seems like madness.
maybe that would help?
That appears to require a selector. I assume that means you know where you’re going to add the element.
I don’t really want to have to bake global knowledge of the document. I just want a darn event to fire. 🙂
I guess maybe the selector could be by ID?
Fair enough, but a selector could be anything right?
you could use gensym and a custom attribute to find it
Yes, that actually might work. I dig it!
I feel like I tried this at one point but I’m not sure I got quite that far.
Yeah, this looks legit.
np, just thinking out loud 😛
Ha. Still probably better than spinning in a loop forever like
Yes, it would run at every mutation.
So I guess it depends on how efficient
querySelctorAll is. If that’s super fast then you’re probably okay.
I would imagine it’
s pretty darn fast.
yesterday I read about another interesting alternative technique to MutationObservers. http://www.backalleycoder.com/2012/04/25/i-want-a-damnodeinserted/ https://github.com/naugtur/insertionQuery