Instagram widget feed function I've adapted an Instagram widget from this example so that it now appends 8 images to their respective IDs using an Instagram username. I want my widget implementation to be better and more efficient.  I'm very new to this so I'm sure there are parts that are no longer needed or that could be greatly improved.

var accessToken = ''; // Access token
var instagram = function () {
  return {
    getUserIDByUsername: function (strUser) { // By username
      var getUserURL = 'https://api.instagram.com/v1/users/search?q=' + strUser + '&amp;access_token=' + accessToken + ''
      $.ajax({
        type: "GET",
        dataType: "jsonp",
        cache: false,
        url: getUserURL,
        success: function (data) {
          var getUserID = data.data[0].id;
          instagram.getUserDetailsByUserID(getUserID);
        }
      });
    },
    getUserDetailsByUserID: function (userID) { // By userid
      $.ajax({
        type: "GET",
        dataType: "jsonp",
        cache: false,
        url: "https://api.instagram.com/v1/users/" + userID + "/?access_token=" + accessToken + "",
        success: function (data) {
          if (data.meta &amp;&amp; data.meta.code == "200") {
            //console.log(data);
            instagram.loadImages(userID);
          } else if (data.meta &amp;&amp; data.meta.code == "400" &amp;&amp; data.meta.error_message) {
            console.log(data.meta.error_message);
          }
        }
      });
    },
    loadImages: function (userID) { // Get user photos
      var getImagesURL = "https://api.instagram.com/v1/users/" + userID + "/media/recent/?access_token=" + accessToken + ""
      $.ajax({
        type: "GET",
        dataType: "jsonp",
        cache: false,
        url: getImagesURL,
        success: function (data) {
          console.log(data);
          size = data.data[0].images.standard_resolution.url;
          $("#insta-1").append("&lt;a target='_blank' href='" + data.data[0].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[1].images.standard_resolution.url;
          $("#insta-2").append("&lt;a target='_blank' href='" + data.data[1].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[2].images.standard_resolution.url;
          $("#insta-3").append("&lt;a target='_blank' href='" + data.data[2].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[3].images.standard_resolution.url;
          $("#insta-4").append("&lt;a target='_blank' href='" + data.data[3].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[4].images.standard_resolution.url;
          $("#insta-5").append("&lt;a target='_blank' href='" + data.data[4].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[5].images.standard_resolution.url;
          $("#insta-6").append("&lt;a target='_blank' href='" + data.data[5].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[6].images.standard_resolution.url;
          $("#insta-7").append("&lt;a target='_blank' href='" + data.data[6].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[7].images.standard_resolution.url;
          $("#insta-8").append("&lt;a target='_blank' href='" + data.data[7].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
        }
      });
    }
  }
}();
$(document).ready(function () {
  var strUser = "saturdaysnyc"; // Instagram username
  if (isNaN(strUser)) {
    instagram.getUserIDByUsername(strUser);
  } else {
    instagram.getUserDetailsByUserID(strUser);
  }
});
first thing one could spot is this duplications:

size = data.data[0].images.standard_resolution.url;
          $("#insta-1").append("&lt;a target='_blank' href='" + data.data[0].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[1].images.standard_resolution.url;
          $("#insta-2").append("&lt;a target='_blank' href='" + data.data[1].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[2].images.standard_resolution.url;
          $("#insta-3").append("&lt;a target='_blank' href='" + data.data[2].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[3].images.standard_resolution.url;
          $("#insta-4").append("&lt;a target='_blank' href='" + data.data[3].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[4].images.standard_resolution.url;
          $("#insta-5").append("&lt;a target='_blank' href='" + data.data[4].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[5].images.standard_resolution.url;
          $("#insta-6").append("&lt;a target='_blank' href='" + data.data[5].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[6].images.standard_resolution.url;
          $("#insta-7").append("&lt;a target='_blank' href='" + data.data[6].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");
          size = data.data[7].images.standard_resolution.url;
          $("#insta-8").append("&lt;a target='_blank' href='" + data.data[7].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;");


One could change it to something more condensed like:

for(var i=0; i&lt;9; i++) {
    size = data.data[i].images.standard_resolution.url;
    $("#insta-"+i).append("&lt;a target='_blank' href='" + data.data[i].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;")
}


Also creating new nodes multiple time is ineficient since browser will re-paint it every time, so you could change it to (I assume that #insta-X elements are just your way to hook it in some place in html, if that's the only reason you may ditch them and create ie. &lt;div class="insta-container"&gt;&lt;/div&gt;)

links = "";
for(var i=0; i&lt;9; i++) {
    size = data.data[i].images.standard_resolution.url;
    links += "&lt;a target='_blank' href='" + data.data[i].link + "'&gt;&lt;img src='" + size + "'&gt;&lt;/img&gt;&lt;/a&gt;";
}
$(".insta-container").append(links);


Also it looks like with size you accidentally declare global variable (window.size) - not a good idea - you need to make var size to make it local: 

loadImages: function (userID) { // Get user photos
      var size, //declare local var, then use it as before
          getImagesURL = "https://api.instagram.com/v1/users/" + userID + "/media/recent/?access_token=" + accessToken + ""
      ;


Also you may want to read about hoisting to know those var ... declarations should be at the top of your function.