(Why) does this ajax queue overwrite response data?
<p>I use the ajax-request queue as posted here: <a href="http://stackoverflow.com/questions/3709597/">Wait until all jquery ajax request are done?</a>  </p>

<p>Now i wrote the following code to implement it:  </p>

<pre><code>for (var i=0; i&lt;3; i++) {
    $.ajaxQueue({
        url: '/action/',
        data: {action:'previous',item:i*-1},
        type: 'GET',
        success: function(data) {
            $('.item-history .itemlist').prepend(data['item_add']);
            $('.item-history .itemlist:first .index').html(data['newitemindex']);
            //alert(data['newitemindex'])       
        };
    });
</code></pre>

<p>As long as i use the alert to proof the response from the server, everything works fine. But as soon as i run the code, as shown, without the alert, data['newitemindex'] behaves as it was a global variable - it always returns the value of the last item.  </p>

<p>I tried to set up a jsfiddle on this, but as i have never used that site, i could not get the ajax to work. If somebody wants to have a look at it anyway: <a href="http://jsfiddle.net/marue/UfH5M/26/" rel="nofollow">http://jsfiddle.net/marue/UfH5M/26/</a></p>
