How can execute Javascript function with parameters via GeckoFX?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

How can execute Javascript function with parameters via GeckoFX?

cnhx27
I try to execute a javascript function with some arguments via GeckoFX and C# but I can not.

I try without results with this C# code :

string JSresult = "";
string JStext = @"
function GeckoFXJSTest(val1, val2)
{
   return val1 + val2;
}
";

GeckoScriptElement script = GeckoBrowser.Document.CreateElement("script") as GeckoScriptElement;
script.Type = "text/javascript";
script.TextContent = JStext;
GeckoBrowser.Document.Head.AppendChild(script);
using (AutoJSContext JScontext = new AutoJSContext(GeckoBrowser.Window.JSContext))
{
   JScontext.EvaluateScript("GeckoFXJSTest(10,7)", out JSresult);
}

Can anyone help me?
_______________________________________________
dev-embedding mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-embedding