Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script>
var onreadys = function(){
console.log(document.readyState);
console.log(document.body);
if( (/^loaded|^i|^c/).test(document.readyState) ){
console.log('found images: '+ document.getElementsByTagName('img').length);
}
};
if(document.addEventListener){
document.addEventListener('readystatechange', onreadys, false);
} else if(document.attachEvent) {
document.attachEvent('onreadystatechange', onreadys);
}
</script>
</head>
<body>
<div>
</div>
<script src="//code.jquery.com/jquery-1.11.0.js"></script>
<p>Printed by IE8/IE9:</p>
<pre>
LOG: interactive
LOG: [object HTMLBodyElement]
LOG: found images: 0
LOG: complete
LOG: [object HTMLBodyElement]
LOG: found images: 3
</pre>
<img />
<img />
<img />
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.