Juan R Labrada

Note Details
OVERLINE
How to load a script dynamically

(function() {
var script = document.createElement(‘script’);
script.async = true;
var useSSL = ‘https:’ == document.location.protocol;
script.src = (useSSL ? ‘https:’ : ‘http:’) + ‘//’ + ‘TARGET_URL’;
var node = document.getElementsByTagName(‘script’)[0];
node.parentNode.insertBefore(script, node);
})();

Rate this note
Comment
Comments
Back to Notes