each or map but deferred

each or map but deferred

Hi,

Just getting my hands on jquery.
  1. $('body').find('div[id^="plugin-load"]').map(function(i, elem) {
       var plugin_id = $(this).attr('data-plugin-id').trim();
       $(this).PlugLoader({data: {"pid":plugin_id} });
    });

PlugLoader is custom jQuery plugin. It is doing so many stuff like ajax get request, compilation of template using handlebars when data is received and some other stuff. I would like to change code in such a way that until PlugLoader is not done, each/map should wait before executing next iteration.