admin管理员组

文章数量:1291503

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.

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.

Share edited Jan 12, 2014 at 19:25 megawac 11.4k6 gold badges42 silver badges61 bronze badges asked Dec 18, 2012 at 20:59 ccunniccunni 1351 gold badge2 silver badges7 bronze badges 3
  • 2 You're wondering why IE is behind others with implementing something? – Ian Commented Dec 18, 2012 at 21:03
  • 1 sadly, caniuse. is silent on the topic. – John Dvorak Commented Dec 18, 2012 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 Commented Dec 31, 2012 at 23:23
Add a ment  | 

3 Answers 3

Reset to default 3

IE 11 supports MutationObservers natively. For IE 9-10 you can use this polyfill: https://github./Polymer/MutationObservers

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

  • Make your HTML/JavaScript app accessible – Windows 8 app developer blog

  • onpropertychange for a textbox in Firefox?

  • callback from flashembed of jquery Tools

For patibility with IE9-10, https://github./webmodules/mutation-observer exposes the native MutationObserver API provided by the browser, or a polyfill based on mutation events.

本文标签: javascriptAvailability of MutationObservers in Internet ExplorerStack Overflow