Rank: Newbie Groups: Member
Joined: 1/4/2016 Posts: 4
|
c# code:
m_WebView.RegisterJSExtensionFunction("InvokeCallback", new JSExtInvokeHandler(WebView_JSInvokeCallback));
public void WebView_JSInvokeCallback(object sender, JSExtInvokeArgs e) { //e.Arguments[0] is show a function, but how to get this?,i want get this function, and EvalScript this. //e.Arguments[1] is "a123" }
js code:
InvokeCallback(function (msg) { var element = document.getElementById("p2"); element.innerHTML = msg; },"a123");
so,is there a way to pass a JSFunction to c#? thx
|
Rank: Administration Groups: Administration
Joined: 5/27/2007 Posts: 24,229
|
Hi, I am not sure if you can invoke back into the JavaScript engine from your C# side JS extension handler because this would cause re-entering the JavaScript engine. Have you tried to cast it to a JSFunction and then call it's Invoke method? http://www.essentialobjects.com/doc/eo.webbrowser.jsfunction.invoke_overloads.aspxThanks!
|
Rank: Newbie Groups: Member
Joined: 1/4/2016 Posts: 4
|
Thank you for your prompt reply!
I solve this. thanks
|