문제

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.

도움이 되었습니까?

해결책

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

다른 팁

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top