# scriptloader **Repository Path**: mirrors_alexgorbatchev/scriptloader ## Basic Information - **Project Name**: scriptloader - **Description**: Absurdly simple on-demand script loader. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-09-24 - **Last Updated**: 2026-07-11 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # scriptloader Absurdly simple on-demand script loader. ## Installation ### component $ component install timoxley/scriptloader ### npm/browserify $ npm install scriptloader ## API ```js var load = require('scriptloader') load('//my-widget.js') // load js from current domain load('//remote.com/their-widget.js') // load js from remote domain // returns the script. you can listen for load/error on this directly load('//cdnjs.cloudflare.com/ajax/libs/json3/3.2.4/json3.min.js').addEventListener('load', function() { console.log('it is loaded') }) // or just supply a callback load('//cdnjs.cloudflare.com/ajax/libs/json3/3.2.5/json3.min.js', function(err, script) { console.log('it is loaded') }) ``` #### What is this sorcery? scriptloader appends a `script` tag to your `document.body` with the `src` attribute set to the script you desire to load. #### Why not just domify to add a script tag? Interesting problem. [Unfortunately we can't use domify to do this]((https://github.com/component/domify/issues/14) since `