Hmm how can I make OnLoad async in this case?
Otherwise I have to throw in many code within the OnLoad closure.
$.each(data, function() {
albumPhoto = 'http://assets.example.com/' + this.photo;
var temp_img = new Image(),
albumPhotoWidth, albumPhotoHeight
temp_img.src = albumPhoto;
temp_img.onload = function() {
console.log(this.naturalWidth) // have something
albumPhotoWidth = this.naturalWidth;
albumPhotoHeight = this.naturalHeight;
}
console.log(albumPhotoWidth) //undefined ?? I want to use it here
});