JQuery question
<p>i want to run some code on all my treeView nodes depending on a value returned from the database and repeat this until a certain value is returned.</p>

<p>I was thinking that:</p>

<ol>
<li>Give all my tree nodes the same css class so I can access them from JQuery</li>
<li>have a timer in my JQuery function that used ajax to go to the database, when a certain value is returned then stop the timer</li>
</ol>

<p>Two questions here. How can I make my function run for each of the nodes and how do I do a timer in JavaScript, so:</p>


$(function(){
    $('cssClassOfAllMyNodes').WhatFunctionToCallHere?((){

<pre><code>//How do I do Timer functionality in JavaScript?
ForEachTimeInterval
{
   //use Ajax to go to database and retrieve a value
   AjaxCallBackFunction(result)
   {
     if (result = 1)
     //How to stop the timer here?
   }
}
});
</code></pre>

<p>});</p>

<p>Hope i'm clear. Thanks a lot</p>
