Lightweight ES5 and DOM shim with IE6 and IE7 support
Pull request Compare This branch is 45 commits behind 0.8.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

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

based on:

Status: Stable Beta Demo Try it in IE7 (or in IE6 ¬_¬)! And take a look at the source


  • 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
  • some extra stuff (if you don't need it, use a.noextras.js instead of a.js)

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


(Note: if you don't need EXSTRAs use a.noexstras.js instead of a.js)

  • 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 INCLUDE_EXTRAS == false -> broken Object.defineProperty will be deleted


  • Exporting these objects to global (window)
    1. browser
    2. Utils.Dom.DOMStringCollection
    3. XHR from with customisations
    4. (If where is no any other) $(selector, root) alias for root.querySelector(selector) (with ">[any selector]" support)
    5. $$(selector, root) alias for root.querySelectorAll(selector) (with ">[any selector]" support)
    6. $$0 alias for $
  • Extending objects
    1. Object.append(object, donor, [donor2, ...])
    2. Object.extend(object, donor, [donor2, ...]) (Object.append with overwrite exists properties)
    3. Object.inherit(Child, Parent)
    4. Array.prototype.unique()
    5. String.random(length)
  • Extra polyfills
    1. 'reversed' for
        with DOM API
      1. HTML*Element.labels
      2. HTMLLabelElement.control


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

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)
  3. Incompatibility with [working on it]


  1. Tests
  2. ( &