AJAX call in for loop won't return values to correct array positions
- by Heilemann
I need to get a range of pages using AJAX and put them into an array, where their given place in the array is equal to the i of a for loop (it's a caching-like function for blog pages, and the range of the for loop is entirely variable). I'm doing something akin to the following:
var bongo = new Array();
for (i = 0; i < 10; i++) {
…