Other than using a timer to count the number of elements over time and looking for changes, I can't think of a better way to simulate this event.
Is there some sort of proprietary IE version of DOMNodeInserted? Thanks.
Other than using a timer to count the number of elements over time and looking for changes, I can't think of a better way to simulate this event.
Is there some sort of proprietary IE version of DOMNodeInserted? Thanks.
No, there isn't. The nearest is the propertychange
event, which fires in response to a change in an attribute or CSS property of an element, but it doesn't fire in response to innerHTML
changing, which would have been close to what you wanted.
You can over-ride all the DOM-manipulation methods - appendChild, insertBefore, replaceChild, insertAdjacentHTML, etc - and monitor innerHTML with onpropertychange.
You might be able to come up with a solution that satisfies your requirements.
BTW, it seems that DOMNodeInserted, etc will be deprecated by browsers in the future. See http://www.w3.org/TR/DOM-Level-3-Events/#events-mutationevents