JavaScript fügen Sie das Skript programmatisch in Kopf hinzu

var my_awesome_script = document.createElement('script');

my_awesome_script.setAttribute('src','http://example.com/site.js');

document.head.appendChild(my_awesome_script);
Diz Andriana