This project has moved and is read-only. For the latest updates, please go here.

Calling a JavaScript function from .NET

You can also call a JavaScript function from .NET.

var engine = new Jurassic.ScriptEngine();
engine.Evaluate("function test(a, b) { return a + b }");
Console.WriteLine(engine.CallGlobalFunction<int>("test", 5, 6));

This code outputs "11" to the console.

Next tutorial: Exposing a .NET class to JavaScript

Last edited Aug 25, 2010 at 2:51 PM by paulbartrum, version 5


No comments yet.