Is it possible to apply a delay to sequential iterations of javascript for-loop using jQuery or underline? I have a loop on my page that I use to pop up market notifications when users meet certain conditions, and if there are several conditions, I would like to wave growl notifications rather than appearing several at the same time. Here is the loop:
var badge_arr = response.split("Earned badge:");
for(i = 1; i < badge_arr.length; i++){
responseStr += badge_arr[i];
var badge_info = badge_arr[i].split(':');
var title = 'NEW BADGE UNLOCKED';
var text = 'You just unlocked the badge '+badge_info[0]+': '+badge_info[1];
var img = badge_info[2];
createGrowl(title, text, img);
}
source
share