473,386 Members | 1,674 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

backgroundColor

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.

Jul 24 '05 #1
13 6046
VK
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!?

Jul 24 '05 #2
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.
Jul 24 '05 #3
ASM
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
Jul 24 '05 #4
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
Jul 24 '05 #5
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
Jul 25 '05 #6
VK
> 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.

Jul 25 '05 #7
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.

Jul 25 '05 #8
VK
> 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.

Jul 25 '05 #9
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
Jul 25 '05 #10
VK


RobG wrote:
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


More and more interesting! Thank you.

P.S. And hell on backgroundColor! :-)

Jul 25 '05 #11
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.


There was probably some influence from the use of the nonsense word
"foo" in the surreal comic strip "Smokey Stover". See
<URL:http://www.toonopedia.com/smokey.htm>.

--
John W. Kennedy
"Compact is becoming contract,
Man only earns and pays."
-- Charles Williams. "Bors to Elayne: On the King's Coins"
Jul 25 '05 #12
"Richard Cornford" <Ri*****@litotes.demon.co.uk> writes:
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.


The CSS specification is for CSS content, not setting via Javascript.
The relevant standard for that is the W3C DOM Level 2 Style
specification, in this case the setProperty method on the
CSSStyleDeclaration interface.
<URL:http://www.w3.org/TR/DOM-Level-2-Style/css.html#CSS-CSSStyleDeclaration>

According to specification, the setProperty method is expected to
throw a DOMException if the value to set "has a syntax error and is
unparsable". Whether that includes "somewhat parsable but
meaningless" is not elaborated, but I wouldn't fault a browser for
throwing an exception on any illegal value.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 25 '05 #13
Lasse Reichstein Nielsen wrote:
Richard Cornford writes:
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.
The CSS specification is for CSS content, not setting via
Javascript. The relevant standard for that is the W3C DOM
Level 2 Style specification, in this case the setProperty
method on the CSSStyleDeclaration interface.
<URL:http://www.w3.org/TR/DOM-Level-2-Sty...CSSStyleDeclar

ation>
According to specification, the setProperty method is
expected to throw a DOMException if the value to set "has
a syntax error and is unparsable". Whether that includes
"somewhat parsable but meaningless" is not elaborated, but
I wouldn't fault a browser for throwing an exception on
any illegal value.


But wouldn't that be "has a syntax error and is unparsable" by CSS
standards? And an unknown/unrecognised value (so long as it is not a
syntax error; contains a colon or some such) can be parsed, just as it
would be in a style sheet.

Richard.

Jul 25 '05 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Philip | last post by:
Hey, Is it possible to get the default value of an element's style.backgroundColor property that's set in a css class? Example, since I'm very tired and can't word that any better ;) ...
7
by: Dan V. | last post by:
Still struggling with css. Anyone know how to put a tope background colour (matches the right part of the banner image) that stretches to the max. size of the window like the main div? My header...
1
by: RobG | last post by:
When I set the background colour of an element using tdRef.style.backgroundColor and then read it back, Firefox always gives rgb(r, g, b) regardless of whether I've used rgb(...) or #rrggbb to set...
3
by: Jen | last post by:
Hi. I need to get some "onmouseover behaviour" to work on table rows. I can make the row background to change colors with: "<tr bgcolor="#FFFFFF" onMouseOver="this.bgColor='#FFFFE3';...
2
by: LS | last post by:
Does anybody know if (and then HOW!) can I change the background color of a WindowsForms.TabControl control? It doesn't have any "BackgroundColor" property, how could then I change it? Thanx!!
6
by: fallen angel | last post by:
halu there!! i'm a 1month experienced java scripter but got a good hang of it already. hehehe.. i developed a "color selection" tool, similar to the one in flash when you choose a color for a...
10
by: Cliff Cotterill | last post by:
I've tried multiple ways of setting the background-color of a DropDownList, but none seem to work. How can the color be set? I've tried setting the BackGroundColor of the DrowDownList component,...
4
by: André | last post by:
Hi, i created a table with cells. One cell has background-color (LightSlateGray) and contains a label without text but also with a backgroundcolor (red). The width of the label is set by a value...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.