Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chakrit/jquery-deps
Simplified jQuery dependency manager. Concurrent pre-downloading, simple to setup, execution orders are preserved.
https://github.com/chakrit/jquery-deps
Last synced: about 20 hours ago
JSON representation
Simplified jQuery dependency manager. Concurrent pre-downloading, simple to setup, execution orders are preserved.
- Host: GitHub
- URL: https://github.com/chakrit/jquery-deps
- Owner: chakrit
- Created: 2010-03-30T17:09:18.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2013-01-18T16:34:25.000Z (almost 12 years ago)
- Last Synced: 2024-04-15T12:21:32.512Z (7 months ago)
- Language: JavaScript
- Homepage: http://plugins.jquery.com/project/jquery-deps
- Size: 117 KB
- Stars: 5
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
Initialize your dependency graph like this:
$.deps.init('/base/script/url/', {
'site.js': [],
'deps/dep1.js': ['site.js'],
'deps/dep2.js': ['site.js', 'deps/dep2.css'],'my_component.js': ['deps/dep1.js', 'deps/dep2.js']
});Load a component like this:
$.deps.load('my_component.js', function() {
/* something to do after componentXYZ is loaded */
alert("all deps are loaded and executed!");
});The script will lookup in the deps graph you specified using `$.deps.init()` and then make sure they are all loaded *AND* executed (or link-ed in the head) before executing your callback function.
Dependencies and execution order are guaranteed.
### Supported file types:
* **JS** - processed using `$.globalEval`
* **CSS** - processed by adding a new `` element to the page
* **HTML**, **HTM**, **HAML** - processed by adding a new `` element to the page with `type="text/html"` and `id=the_filename-template`, where `the_filename` is replaced with the filename without extension (e.g. `mywidget.html`, once loaded, can be accessed via `$("#mywidget-template").html()`).