Re: Is possible to include js file into another js file?

2010-05-24 Thread Dan Howard
Hi Ivana, What I do is combine Rhino with Velocity. So a get a script and use Velocity like a pre-processor. So I have code like this: // Some script. var hello = 10; #include(/common/StringUtil.js) The #include is a velocity macro which inserts the other js file into the current one.

Re: Is possible to include js file into another js file?

2010-05-24 Thread Daryl Stultz
On Sun, May 23, 2010 at 12:22 PM, Ivana iva.supal...@gmail.com wrote: Hi, I need to define variables and functions in one javascript file, and than include this file into another javascript file and use them. Is that possible (even if is needed to use java interface)? I use an approach

Re: Is possible to include js file into another js file?

2010-05-24 Thread Mark Porter
You can use Rhino's CommonJS support by implementing org.mozilla.javascript.commonjs.module.Require, which can be done inside JS. I am using this in Myna[1] and you can see how I'm doing it here[2]. Basically you need to let Rhino know how to resolve CommonJS classpaths, and it takes care of the