There is only one truth. It is the source.

Inject script tag

January 17, 2015

Tags: javascript

Use rawgit.com to serve files from GitHub with the correct content type.

(function(d, script) {
    script = d.createElement('script');
    script.type = 'text/javascript';
    script.async = true;
    script.onload = function(){
        console.log('remote script has loaded');
    };
    script.src = 'https://rawgit.com/epeli/underscore.string/master/dist/underscore.string.js';
    d.getElementsByTagName('head')[0].appendChild(script);
}(document));