How to get ScriptEngine to run multiple javascript files?

I have 6 js files and I need to include them in the final script in order to pass the ScriptEngine eval method. How can i do this? ScriptEngine do not have an add () method. I can read them using FileReader and concatenate these lines, but I think that would be a better way.

+5
source share
2 answers

You can use overloading eval(Reader)to not load scripts in Stringyourself.

+5
source

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

Example:

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

100% , , 6 .

+1

All Articles