Page load times with iframes
I could probably go benchmark this myself but I'm not 100% sure how to go about it so I'm asking here to see if anyone knows the answer to the problem already.
I have some webpage, it has a load of content on it and say, an ad in its own iframe. The ad has some html which then includes some more resources. The html for the ad and all resources it requires are served from a separate domain to the parent page.
What parts of the iframe will delay the onload event of the parent page firing? Also, if different, what parts of the iframe need 开发者_如何学JAVAto load for tracking like Google Analytics to decide the parent page has finished loading?
The onload event isn't guarenteed to fire after all of the DOM has been loaded.
Quite often you'll find the onload event firing way before the DOM has fully loaded, as many a Javascript developer can tell you.
I'd summise from this that your iframe will have little, if any, effect on the onload event firing.
精彩评论