posted by Steve Souders, March 26, 2008 10:10 AM
The way external scripts are typically loaded is with the SCRIPT SRC attribute. Unfortunately, this blocks the browser from downloading any other resources in parallel until the script is done. It also blocks any progressive rendering in the page below the script. Notice if you click the Reload button how everything above the horizontal line is rendered, but the rest of the page remains blank for about 8 seconds. (Right below the line are two scripts that each take 2 seconds to download plus 2 seconds to execute. Loaded sequentially, they block the page for 8 seconds.) These problems are going to become worse as web sites move to using more and more JavaScript. Fortunately there are several ways to avoid these issues as shown in the remaining examples.<HTML>
<HEAD>
</HEAD>
<BODY>
- external script
on domain1 with a 2 second delay with a 2 second execute time using HTML tags
- external script
on domain1 with a 2 second delay with a 2 second execute time using HTML tags
- image
on domain3 with a 1 second delay using HTML tags
- iframe
on domain4 with a 1 second delay using HTML tags
- external stylesheet
on domain5 with a 1 second delay using HTML tags
</BODY>
</HTML>
Cuzillion