Executing a script runs a script from start to finish. For example, to execute the script at "c:\test.js" use the following code:
var engine = new Jurassic.ScriptEngine(); engine.ExecuteFile(@"c:\test.js");
If you have the code to run in a string, use the Execute() method:
Execute()
var engine = new Jurassic.ScriptEngine(); engine.Execute("console.log('testing')");
Note: executing a script is different from evaluating it in the following ways:
Evaluate()
The specification uses the terms "global code" and "eval code" to describe these differences.
Next tutorial: Accessing and modifying global variables
There was an error while loading. Please reload this page.