Loop timer in javascript
<p>I need to execute a piece of javascript code say, each 2000 milliseconds.</p>

<pre><code>setTimeout('moveItem()',2000)
</code></pre>

<p>The above will execute a function after 2000 milliseconds, but won't execute it again.</p>

<p>So inside my moveItem function I have:</p>

<pre><code>function moveItem() {
    jQuery(".stripTransmitter ul li a").trigger('click');
    setInterval('moverItem()',2000);
}
</code></pre>

<p>This does not work because I want to execute the trigger click jQuery piece of code each interval of 2000 milliseconds, but right now it is being called all the time and the script needs to be interrupted. Besides that, I feel this is very bad quality coding... How would you guys solve this?</p>

<p>Thank you a lot.</p>
