I want to load a JavaScript file using Jint, but I cannot figure it out. The documentation said that I can do something like engine.run(file1) , but it seems the files are not loading. Do I need to do something with the file name?
Here is my JavaScript file:
// test.js status = "test";
Here is my c #
JintEngine js = new JintEngine(); js.Run("test.js"); object result = js.Run("return status;"); Console.WriteLine(result); Console.ReadKey();
If I put the code manually in Run , it will work.
object result = js.Run("return 2 * 21;");
source share