0.0.6 • Published 11 years ago
jsdevel-load-script v0.0.6
jsdevel-load-script
Dynamic script loading.
Note
This is fork of eldargab/load-script. That fork has not bee touched in a year
and I needed some features not available there. If these changes get merged back into
upstream, then I will unpublish this module. Here is where jsdevel-load-script differs:
- The module now accepts 3 params
url, [opts,] [cb] - Opts can take
attrsortext. - The script node is passes as the second argument to the callback.
Installation
via component
$ component install jsdevel/jsdevel-load-scriptvia npm
$ npm install jsdevel-load-scriptAPI
var load = require('jsdevel-load-script')
load('foo.js', function (err) {
if (err) {
// print useful message
}
else {
// use script
// note that in IE8 and below loading error wouldn't be reported
}
})License
MIT
0.0.6
11 years ago