I know lots of web analytic tools use the following script to create a script tag dyanmically:
<script type="text/javascript">
var s = document.createElement( 'script' );
s.type = 'text/javascript';
s.src = 'http://s/s.js';
document.body.appendChild( s );</script>
My Question is if there is a difference if I embed the script statically like the following:
<script type="text/javascript" src="http://s/s.js"></script>
They do it so that it loads asynchronously, or at least so it is only loaded once the normal JS has loaded and been executed. It avoids making the rendering tree wait for this JS to load so the page is quicker.