I want to run Javascript within C# and pass variables between C# and Javascript.
It seems ClearScript is the current stable way to do this.
I have a JavaScript function that looks something like this:
var b = a[0];
var c = a[1];
var d = a[2];
var e = a[3];
rtnstr = "{errmsg: 'calculation never ran'}";
calculation()
function calculation() {
rtnstr = "{ one:'" + a+b "', " two:'" + c+d + "'}";
}
How can I call that in ClearScript passing in the a
array and fetching back the rtnstr
string.
I found this URL: https://clearscript.codeplex.com, which shows how to retrieve an array of integers; I need it to retrieve one String.
I also need to know how to pass in variables; the example does not show that.