Script Shotgun [beta 0.1]
The Script shotgun is a simple script used to request all your external Javascript requests at once. “Why?” you ask! So if you have a heavy site filled with plugins, scripts and what ever else, you may notice a slightly slower load time. This is often due to the amount of the request your website is loading (browsers are limited to 3-6 request for files at a time, such as Javascipt files or images), even if you files are small in size the amount of requests can still slow down you load time.
If your wondering what sites would be super script heavy well WordPress, the king of useless requests, is a prime example of what you could use the Script Shotgun in.
To use The Script Shotgun in you website put the script bellow into your header, then input your own scripts into the “scripts” array and your done!
<script type="text/javascript">
// setting up the vars
var scripts = ["src/js/jquery-animate-css-rotate-scale","src/js/jquery-css-transform",
"src/js/jquery.easing.1.3", "src/js/jquery.easing.compatibility"]
// Script location/name minus the ".js"
//Remember this is an example, you need to put your own scripts here.
var scriptsleght = scripts.length; // gets the length of scripts
var j = scriptsleght - 1; // removes the 0 out of script array.
var i=0; // the for statement var
//The shotgun function
for (i=0;i<=j;i++)
{
// document.write("New script added: "+scripts[i]+".js <br/>"); for basic testing
document.write("<script type='text/javascript' src='"+scripts[i]+".js'></scr"+"ipt>");
// writes all the scripts to your website
}
</script>




