How does JavaScript behave in this situation?
<p>For speed purposes, I'm trying to decide whether to place my JavaScript in the <code>&lt;head&gt;</code> or just before the <code>&lt;/body&gt;</code> of my site. I prefer the head and am not concerned with the extra HTTP request, just the behavior of this script.</p>

<p>Here are the two code snippets, which are loaded back-to-back (Google Analytics):</p>

<p><strong>Script 1:</strong></p>

<pre><code>// Loaded externally:
// &lt;script type="text/javascript" src="google_analytics_1.js"&gt;&lt;/script&gt;

var gaJsHost = (
    ( "https:" == document.location.protocol ) ?
    "https://ssl." :
    "http://www."
);

document.write( unescape(
    "%3Cscript src='" +
    gaJsHost +
    "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"
) );
</code></pre>

<p><strong>Script 2:</strong></p>

<pre><code>// Loaded externally:
// &lt;script type="text/javascript" src="google_analytics_2.js"&gt;&lt;/script&gt;

try {
    var pageTracker = _gat._getTracker( "UA-0000000-0" );
    pageTracker._trackPageview();
}
catch( err ) { }
</code></pre>

<p>With the code above, does JavaScript delay sending the rest of the page until it retrieves <code>ga.js</code>, or does it instead say, "okay, I've got the request for <code>ga.js</code> queued up, now I will continue to send the rest of the page while we wait for it to download to the client..."?</p>

<p>My instinct tells me it is linear, and that the page will be delayed until <code>ga.js</code> has been completely downloaded by the client. Is that right?</p>
