According to Yahoo’s “Best Practices for Speeding Up your Site”, the pros for using iframes:
- Helps with slow third-party content like badges and ads
- Download scripts in parallel
but the cons are:
- Costly even if blank
- Blocks page onload
I want to use an iframe to load ads using the technique mentioned on this site:
http://meanderingpassage.com/2007/08/15/keeping-javascript-widgets-from-controlling-your-blog/
Does using this technique mean that as soon as the html contents requested by the iframe are returned to the client, it will load the ad script, potentially blocking the rest of the page’s rendering and downloading? Or will the iframe request get processed concurrently while rest of the document is downloaded and rendered?
I’m, however, not looking for a discussion on the philosophy of whether ads are good or bad.
Answer
Rendering of the interior iframe is processed concurrently with the exterior page. Any javascript inside the iframe will only prevent loading of the contents inside the iframe.
Edit: also, I just noticed I answered your previous question on this subject, and as explained there it’s possible to trigger iframe loading in javascript whenever you wish (e.g. after the rest of the page is loaded).