[HTML] [HEAD] [TITLE]Cycling of BGCOLOR values (June 12th, 2002)[/TITLE] [SCRIPT LANGUAGE="JavaScript" TYPE="TEXT/JAVASCRIPT"] [!-- Hide script from old historical browsers delayAmt = 2000; myColors = new Array( "FF00FF", "00FF00", "000000", "FFBC12", "02458A", "AA579B", "PURPLE", "CDCDCD" ); thisOne = 0; numColors = myColors.length; function rotate() { if (thisOne == numColors) { thisOne = 0; } document.fgColor = document.bgColor; document.bgColor=myColors[thisOne]; thisOne = thisOne + 1; setTimeout("rotate()", delayAmt); } [/SCRIPT] [/HEAD] [BODY BGCOLOR="ABCDEF" onLoad="rotate()"] [CENTER] [H1] FGCOLOR and BGCOLOR and arrays [/H1] [/CENTER] [/BODY] [/HTML]
What error message results, if any, if you take the period out of document.fgColor, making it documentfgColor? Or does the program run without any errors the browser catches, but not do what it used to? Explain this.
What error message results if you take the period out of document.bgColor (only in the statement document.fgColor = document.bgColor)?