共用方式為


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>

代表腳本執行進程的工作。

適用於