var script = document.createElement(‘script’);
script.type = ‘text/javascript’;
script.src = ‘/xxx.js’; //填自己的js路径
document.body.appendChild(script);// 缺点:不能跨域load
# 方法2
(function(){
var i = document.createElement(‘iframe’);
i.style.display = ‘none’;
// i.onload = function() {i.parentNode.removeChild(i);};
// i.name=”;
i.src = ‘http://xxx/xx’;
document.body.appendChild(i);
// i.contentWindow.document.body.innerHTML = ”;
})();