I think you might have come up with document.ready with window.onload
window.onload
, . , , ( -)
document.ready
, DOM. , . , , DOM , .
, 5 ,
:
<script>
$(document).ready(function() {
var imagesLoaded = false;
var imagesTimer = setTimeout("alert('images failed to load')", 10000);
$("img.checkme").load(function(){
imagesLoaded = true;
clearTimeout(imagesTimer);
alert('images loaded within 10 seconds')
});
});
</script>