Connection Information

To perform the requested action, WordPress needs to access your web server. Please enter your FTP credentials to proceed. If you do not remember your credentials, you should contact your web host.

Connection Type

EvaluateJavascriptSync – PB Docs 2022 – PowerBuilder Library

EvaluateJavascriptSync – PB Docs 2022

EvaluateJavascriptSync

PowerScript function

Description

Executes JavaScript synchronously.

Applies to

WebBrowser
control

Syntax

Argument

Description

controlname

The name of the WebBrowser control.

script

The JavaScript to be evaluated. The JavaScript cannot have
statements that show dialog boxes. If a dialog box must be
displayed in JavaScript, the script must be executed
asynchronously.

If there are multiple JavaScript statements, only the last
JavaScript statement will have its result returned.

result

The result of script execution. The execution result is
represented in a JSON string. The supported JavaScript data
types are bool, int, double, string, date, array. When the above
types are mapped to the PowerBuilder data types, they are
boolean, integer, double, string, datetime, array.

For example,

{“type”:”double”,”value”:1585620350123};//returns a
double-type value

{“type”:”string”,”value”:”12d6_1585674123456_74563″};//returns
a string-type value

error

The error information if an error occurs during execution.
The error information is represented in a JSON string. For
example,

{“type”:”error”,”value”:”Uncaught TypeError: Cannot read
property ‘style’ “}

Return value

Integer.

Returns 1 if it succeeds and -1 if an error occurs.

Examples

The following example executes a JavaScript and gets the current
time (double type):

The following example executes a JavaScript and returns an
array:

The following example executes a JavaScript and parses the result (a
JSON string) via the JSONParser object:

See also

CancelDownload

EvaluateJavascriptAsync

GetSource

GoBack

GoForward

Navigate

PrintAsPDF

PauseDownload

RegisterEvent

ResumeDownload

Refresh

StopNavigation

UnregisterEvent

Zoom


Document get from Powerbuilder help
Thank you for watching.
Was this article helpful?
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x