Loading Scripts Without Blocking
Aus Steve Souders neuem Buch: Even Faster Web Sites gibt es eine interessante Übersicht über Möglichkeiten JavaScripte einzubinden in seinem Blog:
There are six main techniques for downloading scripts without blocking:
- XHR Eval - Download the script via XHR and
eval()the responseText.- XHR Injection - Download the script via XHR and inject it into the page by creating a script element and setting its
textproperty to the responseText.- Script in Iframe - Wrap your script in an HTML page and download it as an iframe.
- Script DOM Element - Create a script element and set its
srcproperty to the script’s URL.- Script Defer - Add the script tag’s
deferattribute. This used to only work in IE, but is now in Firefox 3.1.document.writeScript Tag - Write theHTML into the page usingdocument.write. This only loads script without blocking in IE.

