jquery - javascript: time until page load -


i writing animation javascript , want print user loading time until images loaded.

images set in html as: <img src="" />

are there javascript code know when page loaded?
i.e time until onload() event called

you might able @ bottom of page

<span id="imgsmsg"></span> <script type="text/javascript"> var imgs = document.images; var len = imgs.length; var percent = 100; var count=0; var messagecontainer = document.getelementbyid("imgsmsg"); (var i=0;i<len;i++) {    imgs[i].onload=function() {      count++;      messagecontainer = (percent - math.floor((100/len)*count))+"% loaded"; // hope math correct ;)    } } </script> </body> 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -