WebView.InvokeScript(String, String[]) Método

Definição

Observação

InvokeScript pode ser alterado ou indisponível para versões após Windows 8.1. Em vez disso, use InvokeScriptAsync.

Executa a função de script especificada do HTML carregado no momento, com argumentos específicos.

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

Parâmetros

scriptName
String

Platform::String

winrt::hstring

O nome da função de script a ser invocada.

arguments

String[]

Platform::String[]

winrt::hstring[]

Uma matriz de cadeia de caracteres que empacota argumentos para a função de script.

Retornos

String

Platform::String

winrt::hstring

O resultado da invocação do script.

Atributos

Comentários

O script chamado pode retornar apenas os valores de cadeia de caracteres.

Aplica-se a

Confira também