Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jsantell/loadio
A small loader for asynchronously loading JS and CSS files independently, in series or parallel to prevent blocking
https://github.com/jsantell/loadio
Last synced: about 1 month ago
JSON representation
A small loader for asynchronously loading JS and CSS files independently, in series or parallel to prevent blocking
- Host: GitHub
- URL: https://github.com/jsantell/loadio
- Owner: jsantell
- License: mit
- Created: 2012-08-16T14:54:53.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-08-20T01:47:31.000Z (over 12 years ago)
- Last Synced: 2024-10-16T05:44:38.837Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 117 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Loadio
======A small loader for asynchronously loading JS and CSS files independently, in series or parallel to prevent blocking
_v0.1.0_Methods
---* `load( url, callback )` loads a single JS/CSS file and fires the callback upon load
* `series([ urls ], callback )` loads an array of files one after the other with callback firing upon all files loaded
* `parallel([ urls ], callback )` loads an array of files in no order with callback firing upon all files loadedExample
---Load up your files. Note, CSS link nodes do not have an onload event, so they're considered loaded after DOM injection
```javascript
Loadio.load( 'js/file.js', function () {
console.log( 'file.js is loaded' );
});Loadio.series([ 'js/1.js', 'js/2.js', 'js/3.js', function () {
console.log( '1.js, 2.js, 3.js loaded in order' );
});
Loadio.parallel([ 'js/1.js', 'js/2.js', 'js/3.js', function () {
console.log( '1.js, 2.js, 3.js loaded in no order' );
});
```Contributing
---
This project uses [smoosh](https://github.com/fat/smoosh) for compiling, linting.