jQuery sequence

Posted by Happy on Stack Overflow See other posts from Stack Overflow or by Happy
Published on 2010-06-16T19:27:16Z Indexed on 2010/06/16 20:02 UTC
Read the original article Hit count: 126

Filed under:
|
$(".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);
    $.get(item_link, function(data) {
        var src = $('.poster img', data).attr('src');
        img_url.html(src);
    });
});

Each .get should be started after the previous is finished. Now all the .get start in one time.

Any idea?

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about each