1

I'm using this code but I get only an alert, I would like instead to have an img src link from this code:

(function($){
var albumID = 'my albumID';
var albumAPI = "https://api.imgur.com/3/album/" + albumID + "/images";

$.ajax({
  url: albumAPI,
  headers:{
      'Authorization':'Client-ID xxxxxxxxxxxxx'
  },
  type: 'GET',
  dataType: 'json',
  success: function(data) { 

      alert(data.data[0].link);

  },
  error: function() { console.log("ERRORZ"); }
});

})(jQuery);

because I would like use images uploaded on my imgur album on my website, for a gallery.

I tried with echo, echo '<img src="'data'">'; etc, but nothing..

Debbb
  • 21
  • 1
  • 4
  • you can follow the similar question's answer. https://stackoverflow.com/questions/24912112/how-can-i-get-imgur-com-album-images-using-ajax-request – ZhangRan Zhang Nov 07 '18 at 07:04

0 Answers0