开发者

Way to see which elements are still loading and are hindering window.onload from firing?

开发者 https://www.devze.com 2022-12-31 01:49 出处:网络
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.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消