I am doing a simple program in Silverlight to inkove javascript function in silverlight.
The silverlight function is as under
void InvokeJS(params object[] items)
{
object result = System.Windows.Browser.HtmlPage.Window.Invoke("JSFunction", items);
}
Pasing value to this function is happening as under
InvokeJS((object)new object[]{ (object)"10", (object)"20"})
And the JS function is as under
function JSFunction(params) {
alert(params);
}
Now how to read the params value in javascript?
The
paramsvariable is just the first of many arguments being passed in. You can access the other arguments using the following syntax:If you’re passing all the arguments in a single variable, it will be an array so use: