function internetConnectionChecker() {
try {
myImg = new Image();
myImg.src = 'http://ya.ru/logo.png?'+ Math.random();
setTimeout('checkccker()', 2000);
}catch(e) {}
}
function internetConnectionCheckerFinal() {
var status = 'No connection!';
if (myImg.complete) {
status = 'Connected';
}
alert(status);
}
internetConnectionChecker();
Оказывается в W3c не поддерживает свойство Image объекта "complete", однако браузеры IE7, FF3, Opera работают с ним =)
Image Object Properties
| Property | Description | IE | F | N | W3C |
|---|---|---|---|---|---|
| complete | Returns a Boolean value that indicates whether or not the browser is finished loading the image | 4 | 1 | 3 | No |
Комментарии: