is there a way to see wh开发者_开发技巧ich elements of a website are still loading so that window.onload can't fire yet?
I don't know of a global way of doing this - it could well be there is none.
The only thing in that vein that comes to mind is checking images for whether they have successfully loaded. I guess you could walk through each image and check for those properties.
However, you will be having a hard time to tell apart failed image load processes and those still under way. To make that distiction, you would have to work with the onerror
event for each image and set some sort of "failed" flag.
What is going to be really, really hard is controlling slowly loading scripts: If a script loads slowly, there is no execution of JavaScript for that moment, so there is no way to detect any delays here except by using the asnyc
or defer
properties... But I guess that would require fundamental changes to whatever JavaScript you are using.
i don't think so, but if you don't want to wait till all images are loaded, you can use a domready-function
The network-tab in Firebug might help you.
精彩评论