Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > backgroundColor

Reply
Thread Tools

backgroundColor

 
 
cosmic foo
Guest
Posts: n/a
 
      07-24-2005
if i change the backgroundColor of a tag to 'red',
it works in both ie and mozilla.
if i change the backgroundColor of a tag to 'redd',
i get 'invalid property value' in ie, and no error in mozilla.
go figure.



 
Reply With Quote
 
 
 
 
VK
Guest
Posts: n/a
 
      07-24-2005
cosmic foo wrote:
> if i change the backgroundColor of a tag to 'red',
> it works in both ie and mozilla.
> if i change the backgroundColor of a tag to 'redd',
> i get 'invalid property value' in ie, and no error in mozilla.
> go figure.


If I set background-color to "foobar", it doesn't work in neither
browser!. Even more strange: changing "foobar" to "eggog" doesn't
help!?

 
Reply With Quote
 
 
 
 
Richard Cornford
Guest
Posts: n/a
 
      07-24-2005
cosmic foo wrote:
> if i change the backgroundColor of a tag to 'red',
> it works in both ie and mozilla.
> 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 CSS specification requires that unknown/unrecognised properties and
value be ignored. This is generally a good idea as it allows newer
features to be added and not cause problems for older implementations.

IE is in error for complaining instead of ignoring, but that is hardly a
surprise where IE's handling of CSS is concerned.

Richard.


 
Reply With Quote
 
ASM
Guest
Posts: n/a
 
      07-24-2005
cosmic foo wrote:
> if i change the backgroundColor of a tag to 'red',
> it works in both ie and mozilla.
> if i change the backgroundColor of a tag to 'redd',
> i get 'invalid property value' in ie, and no error in mozilla.
> go figure.


and if you write

<p style="backgroundColor='red'">
insteed of
<p style="backgroundColor:'red'">
IE will do it
and Mozilla no






--
Stephane Moriaux et son [moins] vieux Mac
 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      07-24-2005
VK wrote:
[...]
> If I set background-color to "foobar", it doesn't work in neither
> browser!. Even more strange: changing "foobar" to "eggog" doesn't
> help!?


Try 'eggnog' and maybe the waiter will get you one



--
Rob
 
Reply With Quote
 
Robi
Guest
Posts: n/a
 
      07-25-2005
RobG wrote:
> VK wrote:
> [...]
> > If I set background-color to "foobar", it doesn't work in neither
> > browser!. Even more strange: changing "foobar" to "eggog" doesn't
> > help!?

>
> Try 'eggnog' and maybe the waiter will get you one


I've tried 'beer' and my browser started drooling 8-0
 
Reply With Quote
 
VK
Guest
Posts: n/a
 
      07-25-2005
> 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.

 
Reply With Quote
 
Christopher J. Hahn
Guest
Posts: n/a
 
      07-25-2005
VK wrote:
> 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". (?)


I've always understood that foobar derived from the common (at least in
America) acronymn FUBAR, which is inappropriate to expand in a public
forum.

The final four letters, though, indicate: Up Beyond All Recognition.
Guess what the F stands in for.

I may be mistaken there, but considering how terse one can get with the
language, and the incredible amount of magic it performs for you, I've
always felt the acronymn was particularly well-suited.


I'll leave it at that since this is off-topic here.

 
Reply With Quote
 
VK
Guest
Posts: n/a
 
      07-25-2005
> I've always understood that foobar derived from the common (at least in
> America) acronymn FUBAR, which is inappropriate to expand in a public
> forum.


You're right:
<http://whatis.techtarget.com/definition/0,,sid9_gci748437,00.html>
Thank you for the hint.

And "foobar" then must be a "softened" form brought by some
Perl-humorist into the common use. Still in the programming practice
"foobar" is gone so far from the orifinal F-meaning, that now I guess
we can consider it as an all new word.

 
Reply With Quote
 
RobG
Guest
Posts: n/a
 
      07-25-2005
VK wrote:
>>I've always understood that foobar derived from the common (at least in
>>America) acronymn FUBAR, which is inappropriate to expand in a public
>>forum.

>
>
> You're right:
> <http://whatis.techtarget.com/definition/0,,sid9_gci748437,00.html>
> Thank you for the hint.
>
> And "foobar" then must be a "softened" form brought by some
> Perl-humorist into the common use. Still in the programming practice
> "foobar" is gone so far from the orifinal F-meaning, that now I guess
> we can consider it as an all new word.
>


I think you'll find the usage of 'foo' and 'bar' as common dummy names
pre-date Perl (which was 'born' circa 1987).

<URL:http://groups-beta.google.com/group/soc.net-people/msg/716e3446db058d2d>

The link below indicates that foo:

"Probably originally propagated through DECsystem manuals by Digital
Equipment Corporation (DEC) in 1960s and early 1970s; confirmed
sightings there go back to 1972"

<URL:http://www.faqs.org/rfcs/rfc3092.html>

Considerably before the development of Perl.



--
Rob
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
backgroundcolor not rendered with Netscape, Firefox André ASP .Net 4 06-19-2008 07:30 PM
DropDownList BackgroundColor not set Cliff Cotterill ASP .Net 10 11-16-2007 02:27 AM
Textcolor, Backgroundcolor - but i need TextBackgroundcolor ? LeftHorn HTML 11 04-01-2006 08:28 PM
backgroundColor and Firefox RobG Javascript 1 12-12-2004 06:37 AM
default style.backgroundColor value Philip Javascript 1 09-19-2003 05:03 AM



Advertisments