if i change the backgroundColor of a tag to 'redd',
i get 'invalid property value' in ie, and no error in mozilla.
go figure.
The main JavaScript/JScript property (never put in written by ECMA nor
even by browser producers) is the high "durt tolerance". Other words
the interpreter is build on the presumption that the users will try to
code with the maximum violation of coding rules and culture: missing
parenthesis, simicolons, pending else's etc. etc. This tradition comes
from Netscape, because LiveScript from the very beginning was made as a
"folk language" targeted to people who may never ever program before.
If you want to find some property of JavaScript that realy differs it
from other languages then this is one.
Owerall IE is the most "durt tolerant" browser on the market. It will
try to understand any "pidgin script" where any other browser would
give up on the first line.
In case of HTMLElement.style.backgroundColor = "foobar" IE indeed
demostrates some unnecessary "code care".
The assignment backgroundColor = someColor is a request of value to the
build-in color table. So backgroundColor = "redd" is a request of a
value using non-existing key (redd). So programmatically it's equal to
backgroundColor = undefined. So yes, IE should(?) simply ignore it and
use default color instead.
BTW in case of document.body.style.backgroundColor = undefined it does
it (uses default color).
If I set background-color to "foobar", it doesn't work in neither
browser!. Even more strange: changing "foobar" to "eggog" doesn't
help!?
Irrelevant to the topic but maybe useful for the common programming:
The names "foo", "bar" and "foobar" are coming from Perl. Traditionally
they are used to denote some useless variables, functions and objects.
In the code stream it's like a comment: "this statement does nothing
useful, it's only for testing/demonstration purposes". The origin of
these names is lost by now, but we can guess that at least "foo" stays
from "foolish". (?)
"eggog" (originally "EGGOG") is coming from the first calculators with
build-in programming abilities. In case of a fatal math error prosessor
did the registers dump. This dump converted to ASCII was equal to
"EGGOG" string, this is what you saw on the display. From that time in
the programming sub-culture EGGOG means something fatally erroneus
("Change it, or EGGOG will get your program!"). It's getting obsolete
by now.