title: jQuery when each is completed, trigger function
body: <p>how do start a function like redirecting to a new page when .each is done looping my elements?
  this is my current code:</p>
  
  <pre><code>$('#tabCurrentFriends &gt; .dragFriend').each(function(){ 
      var friendId = $(this).data('rowid');
      $.ajax({
          type: "POST", url: "../../page/newtab.php", data: "action=new&amp;tabname=" + tabname + "&amp;bid=" + brugerid + "&amp;fid=" + friendid,
          complete: function(data){
          }
      });
  });
  </code></pre>