loading-script
v1.0.2
Published
Load JavaScript dynamically into the browser
Downloads
4
Maintainers
Readme
Installing
Using npm:
$ npm install loading-script
Using jsDelivr CDN:
<script src="https://cdn.jsdelivr.net/npm/loading-script/dist/loading-script.js"></script>
Using unpkg CDN:
<script src="https://unpkg.com/loading-script/dist/loading-script.js"></script>
Example Usage
Node.js
const {getScript} = require("loading-script");
getScript('test.js', function(){
console.log('onload')
});
Browser
<script src="https://cdn.jsdelivr.net/npm/loading-script/dist/loading-script.js"></script>
getScript('test.js', function(){
console.log('onload')
});