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
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:
- Load JavaScript and CSS resource files asynchronously.
- Manage dependency-order and nested-dependencies across versions.
- Detect if a resource is already loaded.
- Must allow for cross-domain loading (CDN's)
- (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