Share via


WebView2.ExecuteScriptAsync(String) Method

Definition

Asynchronously executes the provided script in the top level document of the WebView2.

public:
 virtual IAsyncOperation<Platform::String ^> ^ ExecuteScriptAsync(Platform::String ^ javascriptCode) = ExecuteScriptAsync;
IAsyncOperation<winrt::hstring> ExecuteScriptAsync(winrt::hstring const& javascriptCode);
public IAsyncOperation<string> ExecuteScriptAsync(string javascriptCode);
function executeScriptAsync(javascriptCode)
Public Function ExecuteScriptAsync (javascriptCode As String) As IAsyncOperation(Of String)

Parameters

javascriptCode
String

Platform::String

winrt::hstring

The script to execute.

Returns

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

A Task that represents the script execution process.

Applies to