NOTE: The plugin quoted here was updated for jQuery 1.5+, follow the link to the original question to get the newest version.
You could use this $.ajaxQueue()
originally posted on my answer to Sequencing Ajax Requests
(function($) {
// jQuery on an empty object, we are going to use this as our Queue
var ajaxQueue = $({});
$.ajaxQueue = function(ajaxOpts) {
// hold the original complete function
var oldComplete = ajaxOpts.complete;
// queue our ajax request
ajaxQueue.queue(function(next) {
// create a complete callback to fire the next event in the queue
ajaxOpts.complete = function() {
// fire the original complete if it was there
if (oldComplete) oldComplete.apply(this, arguments);
next(); // run the next query in the queue
};
// run the query
$.ajax(ajaxOpts);
});
};
})(jQuery);
Applied to your source
$(".item").each(function(){
var item_link = $(this).find("a").attr("href");
$(this).prepend('<div class="img_url"></div>');
var img_url = $('div.img_url', this);
$.ajaxQueue({
url: item_link,
type: 'GET',
success: function(data) {
var src = $('.poster img', data).attr('src');
img_url.html(src);
}
});
});