Using HTML script tags to code while they have a source
<p>I noticed that the <code>&lt;script src="..."&gt;&lt;/script&gt;</code> tag does not allow you to use JavaScript within it, such as:</p>

<pre><code>&lt;script src="myFile.js"&gt;
    alert( "This is a test" );
&lt;/script&gt;
</code></pre>

<p>And this does not work, nor does it throw an error in FireBug, why is this happening, why do we have to add extra <code>&lt;script&gt;</code> tags to allow for JS to be used on the form itself?</p>

<p><em>Example</em></p>

<p>I have a file, found @ <code>script/addScript.js</code> from my root, and this contains:</p>

<pre><code>function addScript( $src )
{
    var script = document.createElement( 'script' );
    script.type = "text/javascript";
    script.src = $src;
    document.getElementsByTagName( 'head' )[0].appendChild( script );
}
</code></pre>

<p>This is designed to allow me to add scripts to the DOM quickly and effectively, so I tried to do this:</p>

<pre><code>&lt;script src="script/addScript.js"&gt;
    addScript( "script/obj.js" );
    addScript( "script/home/login.js" );
&lt;/script&gt;
</code></pre>

<p>But it did not work, so I have to do this instead:</p>

<pre><code>&lt;script&gt;
    addScript( "script/obj.js" );
    addScript( "script/home/login.js" );
&lt;/script&gt;
</code></pre>