setInterval( ) -- unexpected identifier - but it works once
<p>Why do I get <code>Uncaught SyntaxError: Unexpected identifier</code> if it works once?</p>

<p>There are a bunch of these on <a href="http://stackoverflow.com/search?q=unexpected%20identifier">StackOverflow</a>.  The punchline is usually a typo somewhere in the script.</p>

<p>It works once, then it gives 1 error message a second.  </p>

<p>Here I am changing the colors of states on a map:</p>

<pre><code>&lt;!-- language: lang-js --&gt;
&lt;script type="text/javascript"&gt;
colors = [ 'rgba(255,0,0,0.1)','rgba(0,255,0,0.1)','rgba(0,0,255,0.1)'  ];

$(document).ready(function(){

    setInterval(
        $("ul").children().eq( Math.floor(50*Math.random())).css('color', colors[Math.floor(3*Math.random())] )
    ,1000);

});
&lt;/script&gt;
</code></pre>
