So say I have an html document with a single hard coded ul tag element, and a single script tag that links to a loader.js file. This loader.js file can then be used to load additional scripts that do something with that ul tag.
The loader.js file might look something like this:
One of the scripts is a foo.js file that looks like this.
And a bar.js file that looks like this.
this simple script loader will load scripts in order one at a time which is important if one script depends on something that a previous script does. There is the question of loading all scripts at once, and then executing them all in the proper order, this is where module patterns like AMD come into play, and more sophisticated script loaders that make use of that standard.