什么叫"一个js文件怎么引用另一个js"?
是指一个JS文件里的函数调用另一个JS文件里的函数呢?还是指一个JS文件包含另一
个JS文件?前者应该是自动的,后者可以用
<script language="javascript" src="file1.js"></script>file1.js:
var file2 = '<script language="JavaScript"  src="http://whatever/file2.js"><\/script>'; document.write(file2);
 
来实现

解决方案 »

  1.   

       谢了…是第一种,不过第二种也可以实现第一种吧。
       第一种怎么会是自动的呢,你说是什么意思,如果是在HTML里,我可以把两个文件都<script langugae=javascript src=*.js></script>引入,他们中间的函数也可以互相调用,但我就是想在一个js里调用另一个js的函数,这样我就可以不用改许多页面了。
       无为兄台,能否说说你的自动是什么意思?
       我怎么给你加分呢?我不知道给你加分了吗?
      

  2.   

    用不着吧。<script language="javascript" src="file1.js"></script>就可以了。第二个文件自然在“file1.js”里调用了。这就是自动,不用你去管的哟!
      

  3.   

    "自动" means you can just call functions in another js file, as long as that js file is included in the same html. Or if that js file is included in another window's html file (from the same domain), say the name of the window is "xxx", you can just do xxx.whatever_js_function_you_want_to_call().