ballhogjoni Posted January 25, 2008 Share Posted January 25, 2008 my error is on line 456 char 4. Can someone helpwith this error? <script type="text/javascript"> var c = new Array("#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55","#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55", "#d6e7f8", "#FFFF55", "#FFFF33", "#FFFF00", "#FFFF33", "#FFFF55"); x = 0; function bg_eff() { col_val = c[x]; document.getElementById("colorize").style.background = col_val; x++; if (x == 64) { document.getElementById("colorize").style.background="#d6e7f8"; <!--Line 456--> clearInterval(change_bg); } } change_bg = setInterval("bg_eff()", 200); </script> Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 25, 2008 Share Posted January 25, 2008 it's because you do not have the id "colorize" defined, by any of your html elements, in your page Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted January 25, 2008 Author Share Posted January 25, 2008 What do you mean? I have a <td> tag as follows <td id="colorize">. Is there something else you mean? Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 25, 2008 Share Posted January 25, 2008 no - but the original example I gave you worked fine (other then the uncompleted author's comments tag you left in there); you must have changed something. look at the original code to see if you can find your error. because all I had to do was take the javascript and add a div or a table or any html element, that allows you to change the background color, and it works perfectly fine (without any errors). http://www.phpfreaks.com/forums/index.php/topic,178342.msg793698.html#msg793698 Quote Link to comment Share on other sites More sharing options...
mainewoods Posted January 26, 2008 Share Posted January 26, 2008 put a 'var' in front of this statement: col_val = c[x]; Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.