动态创建JS

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

element.setAttribute('src', './js/move.js');

document.getElementsByTagName("head").item(0).appendChild(element);

var js = document.createElement("script");
js.src = "webjars/jquery/jquery.min.js?random" + Math.random();
document.body.appendChild(js);

原文地址:https://www.cnblogs.com/lupeng2010/p/6088560.html