Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
Diego Salas Polar16,296 Points
I need another solution to the code I've built.
Happy Coding, Diego Salas
Steven Parker225,712 Points
Here's a few suggestions.
While you're waiting for Dave, I was wondering what role AJAX performs here. It doesn't look like you get any new data so it seems like you could refactor the program to work without it.
Also, it looks like every call to randomRGB creates a new interval that calls itself when it fires, so in just a few seconds there would be an exponential increase in active intervals. You might want to reconsider your intended functionality, and I'd bet you can do what you want with just one interval (or a small fixed number) and no recursion.
Also, you have some rendering HTML in your
head area. That
h1 tag should be moved into the