dominject

Inject scripts and styles into the DOM with duplicate prevention and completion callback support

npm install dominject
8 downloads in the last week
20 downloads in the last month

DOM Inject

Build Status NPM version Gittip donate button Flattr donate button PayPayl donate button

Inject scripts and styles into the DOM with duplicate prevention and completion callback support

Install

Node, Browserify

  • Use: require('dominject')
  • Install: npm install --save dominject

Ender

  • Use: require('dominject')
  • Install: ender add dominject

Usage

var dominject = require('dominject');
var element = dominject({
    type: 'script',
    url: '//some-url.js',
    attrs: {},  // attributes to be added to the injected dom element
    timeout: 60*1000, // defaults to one minute that is allowed before the injection times out
    next: function(err,el){
        // completion callback for once the element has completed or error'd
    }
}); // returns the element that was injected

History

Discover the change history by heading on over to the History.md file.

Contribute

Discover how you can contribute by heading on over to the Contributing.md file.

Backers

Maintainers

These amazing people are maintaining this project:

Sponsors

These amazing people have contributed finances to this project:

Become a sponsor!

Gittip donate button Flattr donate button PayPayl donate button

Contributors

These amazing people have contributed code to this project:

Become a contributor!

License

Licensed under the incredibly permissive MIT license

Copyright © 2013+ Bevry Pty Ltd us@bevry.me (http://bevry.me)

npm loves you