JavaScript (Rhino) use library or include other scripts

前端 未结 4 747
野趣味
野趣味 2020-12-24 06:44

In JDK6, is there a way to load multiple scripts, each in a file, and have the one script reference a method of another script? Sort of like \"include\"?

4条回答
  •  太阳男子
    2020-12-24 07:11

    As long as you use the same scope to execute each file, they will be able to reference functions and variables from previously executed files.

提交回复
热议问题