$.post in for loop
<p>I am using a loop and $.post to fill fields on my website however it is very unreliable, it works sometimes an sometimes it does not, and im not sure what the problem is if anyone has ideas what the problem could be it would be much appreciated.   </p>

<pre><code>for (var i = 0; i &lt; arrayOfObjects.length; i++) {
          var object = arrayOfObjects[i];

            var option = {};
            option['username'] = object.username;
            option['COOKIE'] = $.cookie('Favorites');
            option['INITIAL'] = 'A';


            $.post("/user/favorite.do", option, function (resp) {
              var obj = $.parseJSON(resp);
              $("#AddFavorite:eq("+i+")").html(obj.txt);

}
</code></pre>
