WebMessageReceived
PowerScript event
Description
Occurs when a message sent by JavaScript on the web is
received.
You can send a message from Web (JavaScript) to the PowerBuilder
application (PowerScript) by executing the following JavaScript on the
web:
|
1 |
window.chrome.webview.postMessage(`SetTitleText ${titleText.value}`); |
Or
|
1 |
window.webBrowser.postMessage(`SetTitleText ${titleText.value}`); |
Syntax
|
1 |
WebMessageReceived (string uri, boolean isJson, string webmessage) |
Event ID
|
Event ID |
Objects |
|---|---|
|
None |
Webbrowser controls |
Arguments
|
Argument |
Description |
|---|---|
|
uri |
The URI of the DOM webpage that sends this |
|
isJson |
Whether the message is in the JSON TRUE indicates that the message is in the JSON |
|
webmessage |
The received message, which can be in the JSON format |
Return Values
None
Examples
This example shows how a message sent by JavaScript on the web is
received.
|
1 2 3 4 5 6 7 8 9 10 11 |
//webmessagereceived(string uri, Boolean isjson, string webmessage) //window.chrome.webview.postMessage('getweburl:' + document.URL) If Len(WebMessage) > 0 Then Choose Case Left(WebMessage, Pos(WebMessage,":")) Case 'getweburl:' w_message lw_msg OpenWithParm( lw_msg, uri ) Case Else // End Choose End If |
See also
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest