Skip to content

ExecuteScriptResult.IsSuccessful

property · ExecuteScriptResult · cAlgo.API

DesktopCLICloud

True if JavaScript execution was successful otherwise false

Definition

public bool IsSuccessful {get;}
executeScriptResult.IsSuccessful: bool

Returns bool

Examples

var webView = new WebView { Width = 300, Height = 100 };
webView.NavigateToStringAsync("<html><body>Hello</body></html>");
webView.NavigationCompleted += args =>
{
    var result = webView.ExecuteScript("document.body.innerText");
    Print(result != null && result.IsSuccessful ? "Script executed" : "Script failed");
};
Chart.AddControl(webView);
webView = WebView()
webView.NavigateToStringAsync("<html><body>Hello</body></html>")
webView.NavigationCompleted += lambda args: webView.ExecuteScriptAsync("document.body.innerText", lambda result: api.Print(f"Successful: {result.IsSuccessful}"))
api.Chart.AddControl(webView)