Many different solutions exist.
JSLoad is a Javascript file loader that [they] wrote for Instructables.
jspkg is a package loader for Javascript, based on pluggable loaders for locating and loading scripts into a client-side Javascript application. Orphaned?
The YUI Loader Utility is a client-side JavaScript component that allows you to load specific YUI components and their dependencies [...]