WebView.InvokeScriptAsync method

Applies to Windows Phone only

As an asynchronous action, executes the specified script function from the currently loaded HTML, with specific arguments.

Syntax


public IAsyncOperation<String> InvokeScriptAsync(
  string scriptName, 
  string[] arguments
)

Parameters

scriptName

Type: System.String [.NET] | Platform::String [C++]

The name of the script function to invoke.

arguments

Type: System.String[] [.NET] | Platform::Array<Platform::String> [C++]

A string array that packages arguments to the script function.

Return value

Type: IAsyncOperation<String>

When this method returns, the string result of the script invocation.

Remarks

Note  To prevent malicious code from exploiting your app, be sure to call this method to invoke only scripts that you trust.

The invoked script can return only string values.

Your app might appear unresponsive while scripts are running. Handle the LongRunningScriptDetected event to interrupt a long-running script.

Requirements

Minimum supported client

None supported

Minimum supported server

None supported

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]

Namespace

Windows.UI.Xaml.Controls
Windows::UI::Xaml::Controls [C++]

Metadata

Windows.winmd

See also

WebView
InvokeScript

 

 

Show:
© 2014 Microsoft