Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
* Simple node.js style script loader for modern browsers
function loadScript(src, cb) {
var script = document.createElement('script');
script.async = true;
script.src = src;
script.onerror = function() {
cb(new Error("Failed to load" + src));
script.onload = function() {
module.exports = loadScript;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.