The WebView2 COM API exposes ICoreWebView2::ExecuteScript and is accessible via webview::eval (C++) and webview_eval (C).
So it is our Class TWebView Method Eval()
The WebView2 COM API exposes ICoreWebView2::ExecuteScript and is accessible via webview::eval (C++) and webview_eval (C).
Antonio Linares wrote:Morning Hakan,
This is the code:
#include "FiveWin.ch" //----------------------------------------------------------------------------// function Main() local oWebView := TWebView():New(), aaa oWebView:bOnBind = { | cJson, nCalls | MsgInfo( cJson, nCalls ) } oWebView:Bind( "SendToFWH" ) oWebView:Navigate( "https://datatables.net/examples/data_sources/js_array" ) Sleep( 200 ) oWebView:Eval( 'window.onload = function () { SendToFWH( document.getElementById("example").innerHTML ) }' ) oWebView:Run() oWebView:Destroy() return nil
Going to check your await command...
Hakan,
> Is this procedure wrong for TWebView? any comment?
The example I posted is working fine
> Secondly, How Can I transfer cJson variable to my app? I use public variable, but it does not worked.
Please post an example of how you are doing it