Lightweight ES5 and DOM shim with IE6 and IE7 support
Switch branches/tags
Nothing to show
Clone or download
termi Large update | new methods | bug fixes
- XHR exrta object
+ old spec fix classList polyfill
+ Object.isObject
+ [extras] Object.isPlainObject
+ Object.assign
+ Object.mixin
* Object.create
* new Array.from from latest spec
+ Array.prototype[find, findIndex]
+ String.prototype[trimLeft, trimRight, codePointAt]
* String.prototype[startsWith, endsWith]
+ String.fromCodePoint
+ Number[MAX_INTEGER, EPSILON, parseInt, parseFloat, isNaN, isFinite,
isInteger, toInteger]
+ [extras] Number.isNumeric
+ Math[acosh, asinh, atanh, cbrt, cosh, expm1, hypot, log2, log10,
log1p, sign, sinh, tanh, trunc, imul]
* [extras] DOMStringCollection fix
+ CharacterData.prototype[after, before, replace, remove]
* Fix HTMLSelectionElement.prototype.remove to compare with
* [NodeList, HTMLAllCollection, HTMLCollection].prototype.<methods> =
* RadioNodeList, <form elements>.prototype.labels,
+ [optionaly] Remove legacy methods from String.prototype

+ [extras] Object.isPlainObject (working with DOM-objects)
+ (IE8)Array.prototype.splice (bug in IE8) fix
* add 'main' to known HTML5 tags
* Function.prototype.apply refactoring
* Node.prototype[addEventListener, removeEventListener, dispatchEvent]
polyfill fixes
* [HTMLInputElement, HTMLTextAreaElement].prototype[selectionStart,
selectionEnd, setSelectionRange] polyfill fixes
* (IE8)CSSStyleDeclaration.prototype[float, opacity] fixes
* (IE8)Element.prototype[getAttribute, setAttribute, hasAttribute,
removeAttribute] polyfill fixes
+ (IE8)TextRectangle.prototype[width, height]

<all from a.ie8.js except (IE8)>
* document.createTextNode fix for IE<8
* querySelector[All] and matchesSelector bug fix
* (IE < 8)Element.prototype[getAttribute, setAttribute, hasAttribute,
removeAttribute] polyfill fixes
* (IE < 8)CSSStyleDeclaration.prototype[float, opacity] (returned from
getComputedStyle) fixes

+ ES5/6 test cases (still need more tests)
Latest commit bd9c253 Jun 4, 2013

ES5 and DOM4 shim for all browsers with IE6 and IE7 support

based on:

Status: Stable Beta

  • Simple Demo Try it in IE7 (or in IE6 ¬_¬)! And take a look at the source
  • Complex Demo Not working in IE6 due lack of CSS


  • Normalizing the JS and DOM across all browsers
  • Less code (eg less closures, reusable functions) & file size
  • IE6+ support
  • Include all we need from ES5, ES6 and DOM shim in one file
  • Powerful customisation


  • Add methods such [add/remove]EventListener, querySelector[All], setSelectionRange, etc in IE6+
  • Add Element/Node properties such classList, children, [first/last]ElementChild, reversed, control, labels, etc in IE6+
  • Add methods such insertAdjacentHTML (old FF), stopImmediatePropagation (Opera < 12) and properties reversed, control, labels, etc in W3C browsers
  • Add ES5/6 methods in all browsers
  • Add DOM4 methods append, prepend, after, before, replace, remove, match in all browsers
  • Provide bugs fixing for DOM and ES in IE, Opera, Chrome, FF
  • and more


  • For W3C browsers: ~8KiB gziped
  • For IE8: ~16KiB gziped
  • For IE6/7: ~18KiB gziped

Caution !!!

  • This lib is not about performance in IE < 9
  • The requests should respond with the mime type "text/x-component"
  • That's all cautions


  • For modern browsers: Add main script in head section

         <script src="a.js"></script>
  • For IE8 support:

  1. First[!] add a.ie8.js in head section

       <!--[if IE 8]>
       <script src="a.ie8.js"></script>
  2. Add a.js in head section

       <script src="a.js"></script>
  • For IE6 and IE7, and IE8 support:
  1. Add a.ie8.js and a.ielt8.js, a.js in head section

       <!--[if lt IE 8]>
       <script src="a.ielt8.js"></script>
       <!--[if IE 8]>
       <script src="a.ie8.js"></script>
       <script src="a.js"></script>
  2. Put to the root of your site



IF __GCC__INCLUDE_EXTRAS__ == false -> Broken Object.defineProperty and Object.defineProperties will be deleted

IF __GCC__INCLUDE_EXTRAS__ == true ->

  • Exporting these objects to global (window)
    1. browser
    2. DOMStringCollection
    3. XHR from with customisations
  • Extending objects
    1. Object.append(object, donor, [donor2, ...])
    2. Object.extend(object, donor, [donor2, ...]) (Object.append with overwrite exists properties)
    3. Object.inherits(Child, Parent)
    4. Array.prototype.unique()
    5. String.random(length)

Note: if you don't need Extras set GCC flag __GCC__INCLUDE_EXTRAS__ to false in a.js and recompile a.js using Google Closure Compiler (GCC online)


In addition to __GCC__INCLUDE_EXTRAS__ GCC flag there are a bunch of over flags to enable/disable ES5/6 and DOM3/4 shims in a.js file. After set flags you need to recompile a.js using Google Closure Compiler (GCC online)


If GCC flag __GCC__IS_DEBUG__ == true -> Console fix from

IE < 8 Same-domain limitation

IE requires that the .htc behavior file must be in the same domain as the HTML page which uses it. If you try to load the behavior from a different domain, you will get an "Access Denied" error. Note that the domain must be exactly the same; that means that is a different domain than

IE < 8 Solve Same-domain limitation

Russian instruction in extra/SameDomainLimitation.SOLVE_RUS.odt

Temporary testing

Known issues:

  1. Lack of test cases
  2. Same-domain limitation (can be solve only on server) for IE < 8
  3. Incompatibility with [working on it]


  1. Tests
  2. ( &