Share via


IWebViewControl.InvokeScriptAsync(String, IIterable<String>) Méthode

Définition

Exécute la fonction de script spécifiée à partir du code HTML actuellement chargé, avec des arguments spécifiques, en tant qu’action asynchrone.

public:
 IAsyncOperation<Platform::String ^> ^ InvokeScriptAsync(Platform::String ^ scriptName, IIterable<Platform::String ^> ^ arguments);
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<winrt::hstring> InvokeScriptAsync(winrt::hstring const& scriptName, IIterable<winrt::hstring> const& arguments);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<string> InvokeScriptAsync(string scriptName, IEnumerable<string> arguments);
function invokeScriptAsync(scriptName, arguments)
Public Function InvokeScriptAsync (scriptName As String, arguments As IEnumerable(Of String)) As IAsyncOperation(Of String)

Paramètres

scriptName
String

Platform::String

winrt::hstring

Nom de la fonction de script à appeler.

arguments

IIterable<String>

IEnumerable<String>

IIterable<Platform::String>

IIterable<winrt::hstring>

Tableau de chaînes qui empaquette les arguments à la fonction de script.

Retours

IAsyncOperation<String>

IAsyncOperation<Platform::String>

IAsyncOperation<winrt::hstring>

Objet d’opération asynchrone à partir duquel, en cas d’achèvement réussi, vous pouvez récupérer le résultat de chaîne de l’appel de script.

Attributs

Remarques

o empêcher le code malveillant d’exploiter votre application, veillez à appeler cette méthode pour appeler uniquement les scripts auxquels vous faites confiance.

Le script appelé peut retourner seulement des valeurs de chaîne.

Votre application peut sembler ne pas répondre pendant l’exécution de scripts. Gérez l’événement LongRunningScriptDetected pour interrompre un script de longue durée.

S’applique à