Examples | Help
stevesouders.com
 Cuzillion'cuz there are a zillion pages to check
document.write Script Tag
posted by Steve Souders, April 1, 2008 12:55 AM
NOTE: This example only works in Internet Explorer.
Inserting script into the page using document.write does allow for scripts to be downloaded in parallel with each other in Internet Explorer, but other types of resources (images, stylesheets, etc.) are not downloaded in parallel. Also, the document.write statements must all be in the same inline script block in the page. If you load this page in Firefox you'll notice it takes 2 seconds longer to load because the scripts (which each take 2 seconds to download) are downloaded sequentially in Firefox whereas in Internet Explorer they are downloaded in parallel.

 
<HTML> <HEAD>
    </HEAD> <BODY>
    • external script

      on domain1 with a 2 second delay with a 2 second execute time using document.write

    • external script

      on domain1 with a 2 second delay with a 2 second execute time using document.write

    • 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>