WebView.InvokeScript(String, String[]) 方法

定義

注意

在Windows 8.1之後,可能會變更或無法使用 InvokeScript。 請改用 InvokeScriptAsync

使用特定引數,從目前載入的 HTML 執行指定的腳本函式。

public:
 virtual Platform::String ^ InvokeScript(Platform::String ^ scriptName, Platform::Array <Platform::String ^> ^ arguments) = InvokeScript;
/// [Windows.Foundation.Metadata.Deprecated("Use InvokeScriptAsync instead of InvokeScript. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, Windows.Foundation.UniversalApiContract)]
winrt::hstring InvokeScript(winrt::hstring const& scriptName, winrt::array_view <winrt::hstring const&> const& arguments);
/// [Windows.Foundation.Metadata.Deprecated("Use InvokeScriptAsync instead of InvokeScript. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
winrt::hstring InvokeScript(winrt::hstring const& scriptName, winrt::array_view <winrt::hstring const&> const& arguments);
[Windows.Foundation.Metadata.Deprecated("Use InvokeScriptAsync instead of InvokeScript. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, typeof(Windows.Foundation.UniversalApiContract))]
public string InvokeScript(string scriptName, string[] arguments);
[Windows.Foundation.Metadata.Deprecated("Use InvokeScriptAsync instead of InvokeScript. For more info, see MSDN.", Windows.Foundation.Metadata.DeprecationType.Deprecate, 65536, "Windows.Foundation.UniversalApiContract")]
public string InvokeScript(string scriptName, string[] arguments);
function invokeScript(scriptName, arguments)
Public Function InvokeScript (scriptName As String, arguments As String()) As String

參數

scriptName
String

Platform::String

winrt::hstring

要叫用的腳本函式名稱。

arguments

String[]

Platform::String[]

winrt::hstring[]

字串陣列,會將引數封裝至腳本函式。

傳回

String

Platform::String

winrt::hstring

腳本調用的結果。

屬性

備註

叫用的指令碼可以只傳回字串值。

適用於

另請參閱