WebView2.ExecuteScriptAsync(String) 方法

定义

异步执行 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)

参数

javascriptCode
String

Platform::String

winrt::hstring

要执行的脚本。

返回

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

一个表示脚本执行进程的 Task。

适用于