动态添加js的代码

<script type="text/javascript"> 
var oHead = document.getElementsByTagName ( 'HEAD'). item (0); 
var oScript = document.createElement ( "script"); 
oScript.type = "text / javascript"; 
oScript.src = "test.js"; 
oHead.appendChild (oScript); 
</ script> 

  

posted @ 2013-11-20 13:54  低调的小磁铁  阅读(194)  评论(0编辑  收藏  举报