---
id: "T:cAlgo.API.ExecuteScriptResult"
kind: "class"
namespace: "cAlgo.API"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/ExecuteScriptResult/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# ExecuteScriptResult (class)

The result of JavaScript execution on a WebView control.

Environments: Desktop supported · CLI supported · Cloud supported.

## Definition

```csharp
public class ExecuteScriptResult
```

## Examples

C#:

```csharp
var webView = new WebView();
webView.Loaded += args => webView.NavigateToStringAsync("<html><body>Hello</body></html>");
webView.NavigationCompleted += args =>
{
    var result = webView.ExecuteScript("document.body.innerText");
    Print("Successful: {0}, JSON: {1}", result.IsSuccessful, result.Json);
};
Chart.AddControl(webView);
```

Python:

```python
webView = WebView()
webView.Loaded += lambda args: webView.NavigateToStringAsync("<html><body>Hello</body></html>")
webView.NavigationCompleted += lambda args: api.Print(webView.ExecuteScript("document.body.innerText").Json)
api.Chart.AddControl(webView)
```

## Constructors

- `public ExecuteScriptResult(bool isSuccessful, string json)` — Initializes a new instance of ExecuteScriptResult [details](https://help.ctrader.com/ctrader-algo/references/Controls/ExecuteScriptResult/Constructor/index.md)

## Properties

- `public bool IsSuccessful {get;}` — True if JavaScript execution was successful otherwise false [details](https://help.ctrader.com/ctrader-algo/references/Controls/ExecuteScriptResult/IsSuccessful/index.md)
- `public string Json {get;}` — Returned JSON result of execution. [details](https://help.ctrader.com/ctrader-algo/references/Controls/ExecuteScriptResult/Json/index.md)

