共用方式為


Behaviors and IE10

Hi Everyone,

In this blog post, I’d like to share some of the changes regarding behaviors in Windows Internet Explorer 10. 

Behaviors is a great way to enhance a DOM Element’s capabilities.  However this technology, unique to Internet Explorer programming model, presents a big challenge for web developers wanting to develop web applications that can work on multiple browsers.  With the latest release of Windows Internet Explorer 10 continuing to embrace the web standards, all types of behaviors are considered legacy technologies and should be avoided if possible.  For compatibility reasons, all of these continue to run in document modes < 10 in the desktop version of IE10 running on Intel or compatible processors.

There are two types of behaviors:  script (HTCs) and binary.  Each can be instantiated in the following manners:

  • Attached – instantiated via addBehavior() method or behavior’ CSS property
  • Element – bound to an element via <? Import> and a namespace

Here is how they‘ve changed in IE10:

  • Script-based HTCs are removed from IE10 Standards Mode in both Modern and the Desktop version.
  • Binary behaviors are removed from all Document Modes of Modern IE.
  • Attached binary behaviors will work in all Document Modes of Desktop IE.
  • Element binary behaviors will work in Legacy (Document Mode < 10) Modes of Desktop IE.

The above changes are summarized in the following table:

       
  SCRIPT BINARY
ATTACHED Modern and Desktop, legacy modesDesktop, all modes, x86-based (no WOA)
ELEMENT Modern and Desktop, legacy modes

Desktop, legacy modes, x86-based (no WOA)

 

This blog has been provided to you by Bac Hoang, IE Escalation Engineer.

Comments

  • Anonymous
    October 27, 2013
    Does this mean COM interfaces such as IElementBehavior are deprecated as well?  I want to hook IE's rendering behavior via a BHO, not add a non-standards-compliant element.  Is this still possible in IE10+?
  • Anonymous
    December 04, 2013
    @ Eric MIn general, all types of behaviors should be avoided if possible.  Implementing IElementBehavior would imply that this is a binary behavior.  Depending on how binary behaviors are instantiated, Attached or Element, the table above would apply.  In IE11, support for Binary Behaviors have been removed in Edge Document Mode, see msdn.microsoft.com/.../bg182625(v=vs.85).aspx  for more info.
  • Anonymous
    May 15, 2014
    The comment has been removed