title: callback to function after .each() has completed?
body: <p>Not sure if this is possible or how to go about it. I am using the following in an $.ajax response which works perfectly fine, however, I need to call the function <code>loadSlider();</code> AFTER the loop is finished iterating.</p>
  
  <pre><code>if (response.success)
  {
      $.each( response.screenshots, function( index, value ) {
          //add the slide
          $( '#slider1' ).prepend( '&lt;li data-id="'+value.screenshot_id+'"&gt;&lt;img src="/showimage.php?show='+value.image_filename+'" alt=""&gt;&lt;/li&gt;' );
          //add the pager
          $( '#rslides-pager' ).prepend( '&lt;li&gt;&lt;a href="javascript:;"&gt;# here&lt;/a&gt;&lt;/li&gt;' );
      });
  
      //want to call loadSlider(); AFTER everything above is completed                        
  }
  </code></pre>