stevesouders.com: Don’t docwrite scripts

duane's picture

The problem with document.write for script loading is:

  • Every DOM element below the inserted script is blocked from rendering until the script is done downloading (example).
  • It blocks other dynamic scripts (example). One exception is if multiple scripts are inserted using document.write within the same SCRIPT block (example).

Steve goes into further detail in his post here:
http://www.stevesouders.com/blog/2012/04/10/dont-docwrite-scripts/