Share via


IJSInProcessRuntime.Invoke<TResult>(String, Object[]) Method

Definition

Invokes the specified JavaScript function synchronously.

public TResult Invoke<TResult>(string identifier, params object?[]? args);
public T Invoke<T>(string identifier, params object[] args);
abstract member Invoke : string * obj[] -> 'Result
abstract member Invoke : string * obj[] -> 'T
Public Function Invoke(Of TResult) (identifier As String, ParamArray args As Object()) As TResult
Public Function Invoke(Of T) (identifier As String, ParamArray args As Object()) As T

Type Parameters

TResult T

The JSON-serializable return type.

Parameters

identifier
String

An identifier for the function to invoke. For example, the value "someScope.someFunction" will invoke the function window.someScope.someFunction.

args
Object[]

JSON-serializable arguments.

Returns

TResult
T

An instance of TResult obtained by JSON-deserializing the return value.

Applies to