RunAnonymousFunctionSync
Interface AntViewDocument
Type: Method
Parameters: Integer Id Variant Params String Script String Data
Returns: Integer
Gives you the ability to run an anonymous javascript function via the variable Script.
This is a synchronous function call and thus a blocking call. It will return the result in Data.
You can pass your parameters directly to the anonymous function by using a variant array for Params.
You need to connect your document object to the current WebView control via CurrentBrowser
The function returns:
0 when there's no error.
1 unable to run script.
2 there was a casting error trying return the result as a string in sData.
21 function is already running (can only run one at a time)
22 function timed out
23 document not connected to WebView2 control
24 Script parameter was empty
25 Trying to run a synchronous method from within a WebView2 event
The Synchronous alternative of the RunAnonymousFunction method.
As the function wraps the async bits, you cannot have the asynchronous variant running when you call this.
Beware that you cannot use a synchronous call from within an AntView event.
Introduced in AntView release 1.1.174
AntView - The MS Edge WebView2 ActiveX control Date last changed: 09/25/2024