Question

I have 6 js files and I need to include them all into final script to pass ScriptEngine's eval method.How can I do it? ScriptEngine haven't add() method.I can read them with FileReader and than concatenate those strings but I think there will be a better way.

Was it helpful?

Solution

You can use the overload eval(Reader) to avoid having to load scripts into a String yourself.

OTHER TIPS

You could use one script to call the other 6 scripts.

Example:

function callOtherFunctions() {
   functionOne();
   functionTwo();
   .
   .
   .
   functionSix();
}

Not 100% sure how good that solution will work but it will call all other 6 functions.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top