У меня есть следующий код
$(function () {
$.post("fetch_data.php?url="+$('#url').val(), { }, function(response){
var arrValues = [ "path/to/img1", "path/to/img2", "path/to/img3", "path/to/img4" ]; //output from php
var img = new Image();
$.each(arrValues, function( intIndex, objValue ) {
img.src = objValue;
img.onload = function() {
alert('height: ' + img.height + ' width: ' + img.width);
}
});
});
});
Я новичок в javascript / jquery, этот код возвращает только последнюю ("путь / к / img4") высоту / ширину изображения.* Как мне сделать так, чтобы он возвращал все изображение и ширину массива?