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

PostJsonWebMessage – PB Docs 2022 – PowerBuilder Library

PostJsonWebMessage – PB Docs 2022

PostJsonWebMessage

PowerScript function

Description

Sends the web message in the JSON format to the top-level document
in WebBrowser asynchronously.

Applies to

WebBrowser
control

Syntax

Argument

Description

controlname

The name of the WebBrowser control.

json

The message (in JSON format) to be sent to the top-level
document, for example:

Return value

Integer.

Returns 1 if the function succeeds and a negative value if an error occurs.
If any argument’s value is null, the method returns null.

Usage

In the top-level document of WebBrowser, the web message can be
subscribed or unsubscribed through the following JavaScript:

“handler” is the process of handling specific events. The event args
is an instance of MessageEvent defined in the HTML5 specification. The
event args data property is the JSON string sent by this function
PostJsonWebMessage, and the JSON string has been parsed into the
corresponding JavaScript object. If a navigation occurs before the message
reaches the page, the message will be discarded. This function will
trigger the WebMessageReceived event.

Here is a JavaScript code example:

Examples

This example sends the specified web message in JSON format to the
top-level document to set the color:

See also

NavigateToString

OpenDefaultDownloadDialog

PostStringWebMessage


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