dominject v5.9.0
Inject scripts and styles into the DOM with duplicate prevention and completion callback support
npm
jspm
<script type="module">
import * as pkg from '//dev.jspm.io/dominject'
</script>
This project provides its type information via inline JSDoc Comments. To make use of this in TypeScript, set your maxNodeModuleJsDepth compiler option to 5
or thereabouts. You can accomlish this via your tsconfig.json
file like so:
{
"compilerOptions": {
"maxNodeModuleJsDepth": 5
}
}
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
Discover the release 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:
These amazing people have contributed finances to this project:
Become a sponsor!
These amazing people have contributed code to this project:
Discover how you can contribute by heading on over to the CONTRIBUTING.md file.
Unless stated otherwise all works are:
and licensed under:
4 months ago
4 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
6 years ago
10 years ago
11 years ago
11 years ago
11 years ago