Postmessage Event
10.0A
The Postmessage event is a PL/B Web Server event for the CLIENT object that occurs when a browser 'window' object 'message' event is detected after a JavaScript 'window.postMessage' method is executed. This CLIENT object event communicates data from an iframe to a PWS PL/B event routine. See this link for a description of the 'window.postMessage' method:
Note the following:
The Postmessage event is referenced using an event value of 302. The equated label in PLBEQU.INC for this event is $ClientEventPostMessage.
The Postmessage event data is returned as a JSON string in the ARG1 parameter where the JSON data includes the following JSON field names\data:
|
Value |
Represents the |
|
plbevent |
JavaScript field that must exist in the ARG1 JSON data. The value of this JSON field is ignored. |
|
data |
JavaScript field that contains user specific JSON data. |
|
origin |
JavaScript field that contains the value which is determined from the 'postMessage' 'targetOrigin' parameter. See the above link for more information on the 'targetOrigin' parameter. |
Example of JavaScript 'postMessage' in iframe Javascript:
Example of ARG1 JSON data:
See Also: EVENTREGISTER, Object Events, Object IO Instructions, Object Definitions
![]() |