Lasse said:
I'll agree if you mean the browser is worthless
That depends. I find it a lot easier to dynamically load js files in IE
than any other browser. Simply because it supports the proprietary
method of changing the .src of a script tag with an id. The advantage is
that you aren't continually adding script elements to the document, as
you do when using createElement, although createElement is "W3C DOM".
Which way I do something, whether proprietary then W3C, or W3C and then
proprietary, depends directly on which one is more efficient. Sometimes,
its more efficient to use the proprietary features.
My, or anyone elses, opinion of IE aside, its simply a lot simpler to
script for than other browsers, if for no other reason than its
tolerance of errors.
Writing *only* W3C DOM compliant code will not work, since there are
still worthless browsers in wide use. Writing W3C DOM compliant code
as the primary branch, and then having fallbacks for non-compliant
browsers, is the safest way to script. It has the advantage of working
with any new browser that appears, since they are bound to be W3C DOM
compliant (or at least close). No other way of scripting will give you
forwards compatability (effectively demonstrated by all the "it works
in IE but not in Netscape, what should I do" posts).
Being "W3C DOM Compliant" does not make a browser "non-worthless" nor
does being non-Compliant make it worthless.
And code that works both today and tomorrow is better than code that
only works today. At least if I have to maintain it
That still doesn't always make "compliant code" the most efficient nor
the easiest to maintain. It can be written either way, whether it goes
like this:
if (document.all){
}else
{if (document.getElementById){
}
}
or this:
if (document.getElementById){
}else
{if (document.all){
}
}
It will *still* work tomorrow, the difference is in efficiency. So I
guess I should have said "Efficient proprietary code is better than
less-efficient W3C Dom Compliant code" and I prefer efficiency to
"compliance".