Posted by: Anonymous Coward
on September 30, 2004 10:35 AM
IIRC, there are only two bugs in IE's DOM Level-1 Core support:
1.<nobr> <wbr></nobr>.getAttribute("class") fails so use<nobr> <wbr></nobr>.className when available. 2. tag names are shown upper case regardless so lower case all tag names manually.
I personally have two small functions to deal with these problems once and for all.
As for the rest of the W3C DOM:
DOM Level-1 XML is not supported in IE, but is never necesarry in client side scripts anyway.
DOM Level-1 HTML is fairly well supported, but is almost entirely redundant anyway since most everything it does can be achieved just as easily with DOM Level-1 Core. Keep it simple and use DOM Level-1 Core except where you truly need the HTML module (e.g. submitting a form).
DOM Level-2 CSS has patchy support (can be made to work with enough effort) but is a waste of time anyway since dynamic styling by swithching class attributes is far easier, and allows you to do what you want 99% of the time.
DOM Level-2 Traversal & Range is a stupid paradigm anyway, and buys you nothing over what DOM Level-1 Core provides.
DOM Level-2 Events has patchy support and is an important module. This is a shame but you will get used to the differences and learn to write code that is W3C and IE compatible quite quickly.
DOM Level-3 XPath is an abortion of an API, and for once I would much prefer to do things the IE way anyway. Add a method to the Node object that provides the IE methods selectNodes() and selectSingleNode() using DOM Level-3 XPath. This will make your code far easier to read and works in Moz and IE.
The one place where the W3C-DOM is really lacking is not providing a substitute for the innerHTML method from IE. Since all the browser makers recognise this, it is supported in every browser I know of anyway. Consider it a defacto standard and just use it when you need it.
Not Quite True
Posted by: Anonymous Coward on September 30, 2004 10:35 AM1.<nobr> <wbr></nobr>.getAttribute("class") fails so use<nobr> <wbr></nobr>.className when available.
2. tag names are shown upper case regardless so lower case all tag names manually.
I personally have two small functions to deal with these problems once and for all.
As for the rest of the W3C DOM:
DOM Level-1 XML is not supported in IE, but is never necesarry in client side scripts anyway.
DOM Level-1 HTML is fairly well supported, but is almost entirely redundant anyway since most everything it does can be achieved just as easily with DOM Level-1 Core. Keep it simple and use DOM Level-1 Core except where you truly need the HTML module (e.g. submitting a form).
DOM Level-2 CSS has patchy support (can be made to work with enough effort) but is a waste of time anyway since dynamic styling by swithching class attributes is far easier, and allows you to do what you want 99% of the time.
DOM Level-2 Traversal & Range is a stupid paradigm anyway, and buys you nothing over what DOM Level-1 Core provides.
DOM Level-2 Events has patchy support and is an important module. This is a shame but you will get used to the differences and learn to write code that is W3C and IE compatible quite quickly.
DOM Level-3 XPath is an abortion of an API, and for once I would much prefer to do things the IE way anyway. Add a method to the Node object that provides the IE methods selectNodes() and selectSingleNode() using DOM Level-3 XPath. This will make your code far easier to read and works in Moz and IE.
The one place where the W3C-DOM is really lacking is not providing a substitute for the innerHTML method from IE. Since all the browser makers recognise this, it is supported in every browser I know of anyway. Consider it a defacto standard and just use it when you need it.
#