example: async=true affect on dynamic script execution blocking

load again

This page is inteneded to test how the async attributes affects execution order of script-inserted scripts. In Firefox, scripts execute in the order in which they were inserted; however, setting the async flag to true alters the execution order and allows scripts to execute ASAP.

Unfortunately, this is not the case for a non-remote script element; however, since scripts are deemed to be remote if they contain a SRC attribute, we can "trick" Firefox into believing our local script is remote using a data:uri.

Interestingly, scripts with a data:uri as their src attribute are actually executed sooner than one with just the text attribute set. Note how, in FF 3.6, the first script to load is the last to be inserted. The unforuntate issue here, however, is that, unlike the behavior we see in WebKit and Internet Explorer, script is not executed synchronously.

# insertion order async? remote? delay (ms) duration (ms)
As each script executes, a row is added to the table. The column definitions are:
  1. # -- The row number
  2. order -- The order of insertion
  3. async -- Value of the script element's async property
  4. remote -- Does the script have a remote src
  5. delay -- The server-side delay
  6. duration -- The elapsed time between insertion and execution

This image will delay the window.onload event by two seconds.