<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<script>
function log(arg) {
var div = document.createElement('div');
div.innerHTML = arg;
document.body.appendChild(div);
}
(function() {
var img = new Image();
img.onload = function() {
setTimeout(function() {
log(img.complete + ' load 1 ' + img.getAttribute('complete'));
}, 1);
};
img.src = 'http://javascript.ru/files/onready/img5.php';
document.body.appendChild(img);
log(img.complete + ' not load 1 ' + img.getAttribute('complete'));
}());
(function() {
var img = new Image();
img.onload = function() {
setTimeout(function() {
log(img.complete + ' load 2' + img.getAttribute('complete'));
}, 1);
};
img.onerror = function() {
setTimeout(function() {
log(img.complete + ' error 2 ' + img.getAttribute('complete'));
}, 1);
};
img.src = 'about:blank';
document.body.appendChild(img);
log(img.complete + ' not load 2 ' + img.getAttribute('complete'));
}());
</script>
</body>
</html>
Говорю же, что работает в ИЕ, проверь