jquery display + delay strategy
<p>The following javascript displays the final result (instead of updating every second).  How can I iterate through the result of the getJSON call, display that result, and delay until I display the next element?</p>

<pre><code>function display(state) {
  for (var i=0; i &lt; state.length; i++) {
    $('#someDiv' + i).text(state[i]);
  }
}

$.getJSON('/getdata', function(data) {
  $.each(data, function(key, val) {
    setTimeout(function(){display(val)}, 1000);
  });
}
</code></pre>
