dominject

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

DOM Inject

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

Node, Browserify

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

Ender

  • Use: require('dominject')
  • Install: ender add dominject
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 
    nextfunction(err,el){
        // completion callback for once the element has completed or error'd 
    }
}); // returns the element that was injected 

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

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

These amazing people are maintaining this project:

  • Benjamin Lupton b@lupton.cc (https://github.com/balupton)

These amazing people have contributed finances to this project:

  • Wholesale Blank T-Shirts (www.wholesale-blank-tshirts.com.au)
  • TopBetta (https://www.topbetta.com.au)

Become a sponsor!

These amazing people have contributed code to this project:

Become a contributor!

Licensed under the incredibly permissive MIT license

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