最近遇到一个​​document.write("<script type='text/javascript' src='test.js'></script>")​​​在ie浏览器不生效的问题,可用​​document.createElement("script");​​解决

  var s = document.createElement("script");
s.type = "text/javascript";
s.src = "test.js";
document.getElementsByTagName("head")[0].appendChild(s);

不过document.write方式正确的写法应该如下:
​​​document.write("<script type='text/javascript' src='test.js'><\/script>")​