Thread: Chapter 1
View Single Post
  #2 (permalink)  
Old August 25th, 2009, 04:14 PM
jmcpeak's Avatar
jmcpeak jmcpeak is offline
Wrox Author
Points: 467, Level: 7
Points: 467, Level: 7 Points: 467, Level: 7 Points: 467, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2005
Location: , Texas, USA.
Posts: 87
Thanks: 0
Thanked 18 Times in 17 Posts

Howdy, jmpierson.

It's difficult to discern the problem without seeing your HTML. Can you provide it for us?

The first thought that entered my head is a greater-than sign in the wrong place in your opening <body> tag. For example:

HTML Code:
<body> bgcolor="white">
<p>Paragraph 1</p>
<script type="text/javascript">
   document.bgColor = "red";
Notice the > before the bgcolor attribute. That could explain why you see the the text that you do.

There are a variety of reasons why the page's background color remains white. A typo is probably the most common reason. JavaScript is a very unforgiving language at times. Make sure document.bgColor is typed exactly as you see it in the book. The code will not work if any character is missing, or if a character's case (upper or lower case) is incorrect.

Last edited by jmcpeak; August 25th, 2009 at 04:16 PM.
Reply With Quote