title: Tumblr API jQuery random image
body: <p>I want a random image as background in a div element.<br>
  I use the tumblr API to get images from tumblr.<br>
  The following code works but gets only the last image that is found, how can I get a random image from the array?</p>
  
  <p><a href="http://jsfiddle.net/StevendeJong/9pzhh9z5/2/" rel="nofollow">Working Example: jsfiddle.net/StevendeJong/9pzhh9z5/2</a></p>
  
  <pre><code>$(document).ready(function (){
      var link = "http://api.tumblr.com/v2/blog/www.unsplash.com/posts?";
      $.ajax({
          type: "GET",
          url : link,
          dataType: "jsonp",
          data: {
              api_key: "ClAjag2DrKwJhbFY1aAAwqBUxEFBEOBwc7AzMwXlcaNlp3gZte"
          }
      }).done(function( data ) {
  
          $.each(data.response.posts, function(){
  
              var _photos = this.photos;
  
              $.each(_photos, function(){
                  $('.background').css({
                      "background-image": "url(" + this.original_size.url + ")"
                  });
              });
          });
      });
  });
  </code></pre>