esedic
10/9/2018 - 10:32 PM

Insert script in head with JavaScript

Insert script in head with JavaScript

(function() {
  var d=document,
  h=d.getElementsByTagName('head')[0],
  s=d.createElement('script');
  s.type='text/javascript';
  s.async=true;
  s.src=document.location.protocol + '//script.js';
  h.appendChild(s);
}());