Re: backgroundColor



> 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.

.



Relevant Pages

  • Re: Foxpro 10????
    ... Works very nicely inside an internet Browser. ... I designed / wrote FoxPro code, used FoxPro data tables, etc. ... And struggle along with VBA, JAVA, ODBC and ADO? ... Extremely simple programming under Frontpage, ...
    (microsoft.public.fox.programmer.exchange)
  • Re: Nuts
    ... about the properties and positioning methods you are attempting to use ... I've programming in assembly 15 years ago for about 5 years, ... CSS is not consistant. ... for some browser that is a piece of crap... ...
    (alt.html)
  • Re: Nuts
    ... I've programming in assembly 15 years ago for about 5 years, ... CSS is not consistant. ... do than learn every new super duper programming language that comes a long. ... for some browser that is a piece of crap... ...
    (alt.html)
  • Re: Forth for Kids
    ... If you want to program in such an environment, why not use JavaScript? ... language with a C-like syntax, and with the right browser, it's a quite ... implements and makes JavaScript actually a really useful programming ...
    (comp.lang.forth)
  • Re: Best Vector Graphics Package On Any Platform
    ... Peter Naulls wrote: ... more programming) experienced developers, that number is quite limited, ... seem to be fragmented between your work on Firefox and the Netsurf ... browser strikes me as already so limited as to be incapable of being ...
    (comp.sys.acorn.apps)