Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

re: DOMSubtreeModified Event question



Well, looks like I've answered the question on my own. Mostly.

when changing the contents of a DOM node with this.node.innerText = 'new value' :

    --    DOMNodeRemoved fires once
    --    DOMNodeInserted fires once
    --    DOMSubtreeModified fires twice

so I guess that accounts for 2 instances of DOMSubtreeModified being fired.

when changing the contents of a DOM node with this.node.replaceChild (newVal, theChild) :

    --    DOMNodeRemoved fires twice (!!)
    --    DOMNodeInserted fires once
    --    DOMSubtreeModified fires twice

not sure why DOMNodeRemoved is firing twice, but I think I now know what I need to do what I want to do.

I imagine that an innerText assignment is just a removeNode() event followed by an insertNode() event, so I'll use the DOMNodeInserted event instead of DOMSubtreeModified, and I'll be able to capture any "update" event on a DOM element in the page when it's changed dynamically by innerText, or by replaceChild().

I think I've got it understood right. thanks for listening.



_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webcore-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webcore-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.