p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


  Return to Index  

beginning_java thread: RE: Changing colors


Message #1 by Chanoch Wiggers <ChanochW@w...> on Wed, 3 Apr 2002 09:35:18 +0100
shouldnt this be asked in a javascript forum?

chanoch

-----Original Message-----
From: Christian Dygaard [mailto:cdygaard@w...]
Sent: 02 April 2002 15:13
To: Beginning Java
Subject: [beginning_java] Changing colors


Hello Fellow programmers.

    I'm trying to make a homepage that dynamicly changes the color inside a
table data cell every half a second using javascript, the problem is that
instead of changing colors it writes out the entire javascript into the
table data cell. Here is my code:
Message #2 by "Christian Dygaard" <cdygaard@w...> on Tue, 2 Apr 2002 16:13:27 +0200
Hello Fellow programmers.

    I'm trying to make a homepage that dynamicly changes the color inside a
table data cell every half a second using javascript, the problem is that
instead of changing colors it writes out the entire javascript into the
table data cell. Here is my code:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
	<title>ucsign</title>
</head>

<body BGCOLOR="#FFFFFF">
<!--Screen Table-->
<TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
<TR>
   <TD BGCOLOR="#000000" WIDTH="50%"></TD>
   <TD BGCOLOR="#000000">
      <img src="i/ucsignheading.gif" width="520" height="585" border="0">
   </TD>
   <TD BGCOLOR="#000000" WIDTH="50%"></TD>
</TR>
<TR>
   <TD BGCOLOR="#000000"></TD>
   <TD>
      <!--ucsign table-->
      <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0">
	     <TR>
		    <TD BGCOLOR="#000000" WIDTH="25%"></TD>
			<TD BGCOLOR="#
			<SCRIPT LANGUAGE="JavaScript">
			var arrayIndexNo = 0;
			var colorArray = new Array(FFFFFF, FFFFEE, FFEEEE, EEEEDD,EEDDDD,
			DDDDCC, DDCCCC, CCCCBB, CCBBBB, BBBBAA, BBAAAA, AAAA99);
			function TDColor_Onload()
			{
			   document.write(colorArray[arrayIndexNo])
			   arratIndexNo++;
			   If arrayIndexNo == 12
			   {
			      arrayIndexNo = 0
			   }
			}
			setInterval("TDColor_Onload", '500')
			</SCRIPT>">
			   <img src="i/UCSigns3in1.gif" width="350" height="1050" border="0">
			</TD>
			<TD BGCOLOR="#000000" WIDTH="25%"></TD>
         </TR>
	  <!--ucsign table-->
	  </TABLE>
	</TD>
	<TD BGCOLOR="#000000"></TD>
</TR>
<TR>
   <TD BGCOLOR="#000000"></TD>
   <TD>
      <img src="i/ucsignpurchase.gif" width="520" height="300" border="0">
   </TD>
   <TD BGCOLOR="#000000"></TD>
</TR>
<!--Screen Table-->
</TABLE>
</body>
</html>

What's the problem?
Thanks in advance.
Regards

Christian Dygaard


  Return to Index