new_element=document.createElement("script"); new_element.setAttribute("type","text/javascript");new_element.setAttribute("src","a.js");// 在这里引入了a.js document.body.appendChild(new_element); function b() { a(); } 或使用jquery的$.getScript("a.js",function(){}); IE6下不管用