JSでJSを埋め込む


(function(){
var s = document.createElement('script');
s.src = "https://1.0.0/js/aaa.js?"
Date.now();
document.getElementsByTagName('head')[0].appendChild( s );
})();

 

---------------------------------------


//JSを埋め込む例(参考:GA)

(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();