title: Script Tag - async & defer
body: <p>I have a couple of questions about the attributes <code>async</code> &amp; <code>defer</code> for the <code>&lt;script&gt;</code> tag which to my understanding only work in HTML5 browsers.</p>
  <p>One of my sites has two external JavaScript files that currently sit just above the <code>&lt;/body&gt;</code> tag; the first is <a href="/questions/tagged/jquery" class="post-tag" title="show questions tagged &#39;jquery&#39;" rel="tag">jquery</a> sourced from google and the second is a local external script.</p>
  <h2>With respects to site load speed</h2>
  <ol>
  <li><p>Is there any advantage in adding <code>async</code> to the two scripts I have at the bottom of the page?</p>
  </li>
  <li><p>Would there be any advantage in adding the <code>async</code> option to the two scripts and putting them at the top of the page in the <code>&lt;head&gt;</code>?</p>
  </li>
  <li><p>Would this mean they download as the page loads?</p>
  </li>
  <li><p>I assume this would cause delays for HTML4 browsers, but would it speed up page load for HTML5 browsers?</p>
  </li>
  </ol>
  <h2>Using <code>&lt;script defer src=...</code></h2>
  <ol>
  <li>Would loading the two scripts inside  <code>&lt;head&gt;</code> with the attribute <code>defer</code> the same affect as having the scripts before <code>&lt;/body&gt;</code>?</li>
  <li>Once again I assume this would slow up HTML4 browsers.</li>
  </ol>
  <h2>Using <code>&lt;script async src=...</code></h2>
  <p>If I have two scripts with <code>async</code> enabled</p>
  <ol>
  <li>Would they download at the same time?</li>
  <li>Or one at a time with the rest of the page?</li>
  <li>Does the order of scripts then become a problem? For example one script depends on the other so if one downloads faster, the second one might not execute correctly etc.</li>
  </ol>
  <p>Finally am I best to leave things as they are until HTML5 is more commonly used?</p>