My code
// do ajax request and get JSON response
for (var i = 0; i < data.results.length; i++) { result = data.results[i]; // do stuff and c
Looks like you've got a closure problem. See these questions: