Windows Dev Center

Expand Minimize

WebView.InvokeScript method

[InvokeScript may be altered or unavailable for releases after Windows 8.1. Instead, use InvokeScriptAsync.]

Executes the specified script function from the currently loaded HTML, with specific arguments.

Syntax


public string InvokeScript(
  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: System.String [.NET] | Platform::String [C++]

The result of the script invocation.

Remarks

The invoked script can return only string values.

Requirements (Windows 10 device family)

Device family

Universal

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

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

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

End of client support

Windows 8.1

End of server support

Windows Server 2012 R2

Namespace

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

Metadata

Windows.winmd

See also

WebView
InvokeScriptAsync

 

 

Show:
© 2015 Microsoft