Created
October 20, 2014 17:56
Revisions
-
Alexander Farkas created this gist
Oct 20, 2014 .There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,44 @@ <!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>