var a = 0;
var requestStr ="https://api.flickr.com/services/rest/?method=flickr.interestingness.getList&format=json&nojsoncallback=1&per_page=20&api_key=dc140afe3fd3a251c2fdf9dcd835be5c"; //flickr key.
$.get(requestStr, function(data){
a = data;
});
console.log(a);
This prints out 0, but im trying to save the data
parameter into the global variable a.
I've tried a self invoking function and using a 2nd function to set a = data
, but they don't work.
Honestly can't figure this out.