Есть ли способ в JS для получения прогресса загружаемого изображения во время загрузки изображения? Я хочу использовать новый тег Progress HTML HTML5, чтобы показать ход загрузки изображений.
Мне хотелось бы что-то вроде:
var someImage = new Image()
someImage.onloadprogress = function(e) { progressBar.value = e.loaded / e.total };
someImage.src = "image.jpg";