Choosing a JavaScript Asynch-Loader

Posted by Prisoner ZERO on Programmers See other posts from Programmers or by Prisoner ZERO
Published on 2011-05-16T14:59:16Z Indexed on 2011/06/25 16:29 UTC
Read the original article Hit count: 202

Filed under:
|
|
|

I’ve been looking at various asynchronous resource-loaders and I’m 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:

  1. Load JavaScript and CSS resource files asynchronously.
  2. Manage dependency-order and nested-dependencies across versions.
  3. Detect if a resource is already loaded.
  4. Must allow for cross-domain loading (CDN's)
  5. (optional) Allow us to unload a resource.

I’ve been looking at:

I 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 my requirements fully?
  • Which do you find most eloquent and easiest to work with? And why?

© Programmers or respective owner

Related posts about learning

Related posts about JavaScript