IEtoW3C.js Compatibility Script Documentation

Where To Get It:

What It Does:

The purpose of this script is to modify the MSIE DOM to bring it into near-compliance with the W3C DOM Level 2. Below is a listing of the DOM objects, properties, and methods that are not directly supported by MSIE but are fully or mostly supported by using this script:

DOM Level 2 Events (the biggie)

DOM Level 2 Core

* Note: These are only enabled in XML context, and they don't actually handle namespaces but are just pointers to the built-in createElement() and getElementsByTagName() methods. Use of these is not recommended.

DOM Level 2 Style

DOM Level 2 Views

The items I find most useful are the Events and Style modules. The former unifies the events model, including the entire event capture/bubble flow, and the latter is very useful in finding an element's cascaded style properties.

How To Use It:

Include a <script/> reference to IEtoW3C.js or IEtoW3C-loader.js in your HTML file, before any other scripts. Then freely use the W3C DOM in any following scripts, without having to worry about browser detection or code forking.

See the following resources for more information on using the W3C DOM:

What It Depends On:

None.

Compatibility:

Adds W3C DOM Core, Events, Style, and Views support to Microsoft Internet Explorer. Adds partial W3C DOM Style support to Opera 7.

This script is geared toward fixing the standards support of browsers with broken standards support (mostly Internet Explorer), therefore it should have no effect on other browsers. Conveniently, nearly every other mainstream browser (Mozilla/Netscape, Safari/KHTML, most of Opera 7) appears to have strong enough standards support so as not to need the fixes this script provides, so they ignore it. So theoretically, with use of this script you should be able to write a W3C DOM-compliant script and have it work in any current mainstream browser.

Because standards-compliant browsers don't need this rather large script, there is a small supporting script, IEtoW3C-loader.js, that will only load the full script if it is needed. This gives the full benefit of the script, without making compliant browsers download it.

Demonstration:

Test Cases demonstrating basic and advanced usage

To Do:

Known Issues:

License:

The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The Initial Developer of the Original Code is Jason Johnston (jj{at}lojjic[dot]net). Portions created by the Initial Developer are Copyright (C) 2004 the Initial Developer. All Rights Reserved.

This code is provided for you to use free of charge. If you find it useful please consider making a donation to help me continue to create tools like this one. You can find my contact info at http://lojjic.net.