可以用execScript方法.
execScript Method--------------------------------------------------------------------------------Executes the specified script in the provided language.SyntaxvReturn = window.execScript(sExpression, sLanguage)
ParameterssExpression Required. String that specifies the code to be executed. 
sLanguage Required. String that specifies the language in which the code is executed. The language defaults to Microsoft® JScript®. Return ValueThis method always returns null.

解决方案 »

  1.   

    晕没有包含或引用语句么?execScript好像不能达到这个要求吧?总不至于非要到HTML中去引用吧?
      

  2.   

    你的意思是说先把js文件读到一个变量里,再用execScript来执行?
      

  3.   

    把两个JS文件都包含在同一Html的文件里就行了..
      

  4.   

    就是因为不想这么麻烦啊。。能不能这样:比如File1.js想包含File2.js,在File1.js中输出“<script src="File2.js".....>这样行么?
      

  5.   

    cpunion说的正确
    file1.js:document.write("<scr"+"ipt src='file2.js'></scr"+"ipt>");