I just load Iron JS and after executing some 2/3 simple programs using the Execute method, I study the ExecuteFile method.
I have a Test.js file whose contents are equal
function Add(a,b)
{
var result = a+b;
return result;
}
I want to use the same from C # using Iron JS. How can i do this? My code is bye
var o = new IronJS.Hosting.CSharp.Context();
dynamic loadFile = o.ExecuteFile(@"d:\test.js");
var result = loadFile.Add(10, 20);
But the loadfile variable is null (the path is correct).
How to call JS function, please help ... Also google search did not give any help.
thank
source
share