Can we load other javascripts from javascript?

Oct 9, 2014 at 1:56 AM
I hava a question.

We can load other javascripts from javascript with load("xxx.js") with Rhino.

Can we load other javascripts from javascript with ClearScript?

Could you tell me how we can do for this if we can.
Coordinator
Oct 9, 2014 at 3:36 AM
Hello!

You can easily expose a Rhino-like load() function:
public delegate void LoadFunc(params string[] paths);
// ...
engine.Script.load = new LoadFunc(paths => {
    foreach (var path in paths) {
        engine.Execute(File.ReadAllText(path));
    }
});
Good luck!