Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Background color with javascript

0 views
Skip to first unread message

Rob

unread,
Jan 24, 2002, 11:37:23 AM1/24/02
to
I've tried everything I can think of and looked everywhere, but I can't
change the background color of the DEC window.

I'm invoking the DEC using JScript and have DEC showing up in a DIV
called Composition. I've tried writing a bgcolor attribute into a body
tag and using Compostion.document.write(bodyTag). I've tried setting a
style declaration in an external style sheet and importing it into a var
called styleTag and loading it into the window using
Compostion.document.write(styleTag).

I've tried setting the background color of the div, but that doesn't
work. Is there any way to set the background of the body of the DEC
using JScript? Any help would be appreciated.

Thanks.

<-- Rob

Jonathan Snook

unread,
Jan 24, 2002, 8:49:16 PM1/24/02
to
This is some code I use to set some default properties of my editor:

<script language="JavaScript" FOR="tbContentElement"
EVENT="DocumentComplete">
tbContentElement.DOM.body.style.fontFamily = 'Arial'; // set a default
font
tbContentElement.DOM.body.style.fontSize = '13px'; // set a default font
size
tbContentElement.DOM.body.innerHTML =
document.forms[0].PagContent.value; // copy content over
</script>

You should be able to add this line:
tbContentElement.DOM.body.style.backgroundColor = '#333333'; // set
background color

Jonathan
http://www.snook.ca/

"Rob" <r...@currentmarketing.com> wrote in message
news:3C503843...@currentmarketing.com...

Rob

unread,
Jan 25, 2002, 12:41:43 PM1/25/02
to
I actually figured it out this morning: I was giving the wrong path to the css
file! duh. Your reply, however, helped me out with another problem, so thanks!

<- Rob

0 new messages