Ive been looking at various asynchronous resource-loaders and Im not sure which one to use yet. Where I work we have disparate group-efforts whose class-modules may use different versions of jQuery (etc). As such, nested dependencies may differ, as well. I have no control over this, so this means I need to dynamically load resources which may use alternate versions of the same library.As such, here are my requirements:Load JavaScript and CSS resourcefiles asynchronously.Manage dependency-order andnested-dependencies across versions.Detect if a resource is alreadyloaded.Must allow for cross-domain loading(CDN's)(optional) Allow us to unload aresource.Ive been looking at:CurlRequireJSJavaScriptMVCLABjsI might be able to fake these requirements myself by loading versions into properly-namespaced variables & using an array to track what is already loaded...but (hopefully) someone has already invented this.So my questions are:Which ones do you use? And why?Are there others that my satisfy myrequirements fully?Which do you find most eloquent andeasiest to work with? And why?UPDATE:For those interested, I tried all the AMD libraries above (and more).  In the end, I went with RequireJS.  It's just cleaner and easier overall...and I'm glad to be using it.
Choosing a JavaScript Asynch-Loader
learning;javascript;resources;async
I've used RequireJS on serious projects, and I love it, but it's not really meant to be an asynchronous loader. It's really meant to be a module system. Asynchronous loading is provided in service to that goal. It can be pushed to fill any of your requirements, but its loading services are designed to load modules, not arbitrary files.Load JavaScript and CSS resource files asynchronously: Requirejs loads any modules that you require using script tag injection, so asynchronously.Manage dependency-order and nested-dependencies across versions: This is where RequireJS Shines. Modules may declare dependencies on other modules, and the load order will be extrapolated from that dependency declaration. There is also an order plugin, which can force order on dependencies.Detect if a resource is already loaded: Requirejs will only load a module once.Must allow for cross-domain loading (CDN's): This is possible, but requires some configuration; You may set a specific URL for any module, and that will override the default location, so you can set it to a CDN.RequireJS will serve best if you write modules using its format, and be least effective if you are using it to load raw javascript.It also provides a build process that will merge your modules together into a single file for production.