How can execute Javascript function with parameters via GeckoFX?
Christian LeMoussel <[email protected]> Sun, 11 May 2014 00:53:17 -0700 (PDT)
| Newsgroups | gmane.comp.mozilla.devel.embedding |
|---|---|
| Message-ID | <[email protected]> |
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?