title: Javascript - Wrap my Flickr Api image request with link
body: <p>I need to wrap the image outputted from this request with a link and my API knowledge is limited so unfortunately I have hit a wall.</p>
  
  <p>Here is my current function that outputs the images from the album. Please see fiddle for working version.</p>
  
  <pre><code>    var endpoint = "https://api.flickr.com/services/rest/"
      var apiKey = "e3e0e77b3f6aa14bc816b1e6855f70b7";
      var photosetId = "72157682947882356";
      var extras = "url_sq,url_t,url_s,url_m,url_o";
      var method = "flickr.photosets.getPhotos";
  
      var request = endpoint+"?method="+method+
                  "&amp;api_key="+apiKey+
                  "&amp;photoset_id="+photosetId+
                  "&amp;extras="+extras+
                  "&amp;format=json&amp;jsoncallback=?";
      $.getJSON(request,buildGallery);
  
      function buildGallery(data,result){
          if(result=="success"){
              var photos = data.photoset.photo;
              for(var i=0; i&lt;photos.length; i++){
                  $('&lt;img class="gallery_image" &gt;').attr("src",photos[i].url_m).appendTo(".flicker");
  
              }
          }
  
      }
  </code></pre>
  
  <p><a href="https://jsfiddle.net/samwsmith/88834z4f/" rel="nofollow noreferrer">https://jsfiddle.net/samwsmith/88834z4f/</a></p>
  
  <p>Thanks for you time.</p>