var script = document.createElement('script');
script.src = '外部js文件路径';
document.body.appendChild(script);