AFAIK mutation observers are not available yet in IE. Chrome, Safari, Firefox have their implementations and its working its way through the standardization process. I'm wondering if anyone (preferably MS employee) knows the story with IE, or might give me a pointer to an article I missed.
Asked
Active
Viewed 1.5k times
5
-
2You're wondering why IE is behind others with implementing something? – Ian Dec 18 '12 at 21:03
-
1sadly, http://caniuse.com is silent on the topic. – John Dvorak Dec 18 '12 at 21:04
-
Thanks Jan. Ian, I'm not wondering why they're behind, I'm wondering how long they'll be behind, and if they already offer some faster alternative to binding to the DOM mutation events. – ccunni Dec 31 '12 at 23:23
3 Answers
3
IE 11 supports MutationObservers
natively. For IE 9-10 you can use this polyfill:
https://github.com/Polymer/MutationObservers

Handsome Nerd
- 17,114
- 22
- 95
- 173
1
There's a recent article on Windows 8 app development which uses onpropertychange
to handle DOM mutation.
Example 4: Handle onpropertychange for ARIA-selected property to detect programmatic change of tab selection.
tabElement.attachEvent("onpropertychange", selectionChanged);
function selectionChanged(event)
{
if (event.propertyName === "aria-selected")
{
if (event.srcElement.getAttribute("aria-selected") === "true")
{
// execute code to load the content that corresponds with the selected tab element
}
else
{
// execute code for deselected tab, if needed
}
}
}
References

Community
- 1
- 1

Paul Sweatte
- 24,148
- 7
- 127
- 265
0
For compatibility with IE9-10, https://github.com/webmodules/mutation-observer exposes the native MutationObserver API provided by the browser, or a polyfill based on mutation events.

Won Jun Bae
- 5,140
- 6
- 43
- 49