
CHAPTER 5: Interapplication Communication with Scripts BridgeTalk message object 186
BridgeTalk message object properties
body
String The data payload of the message. Read/write.
X If this is an unsolicited message to another application, typically contains a
script packaged as a string. The target application’s full document object
model (DOM) is available within the script.
X If this message is a result returned from the static BridgeTalk onReceive
method of a target application, directed to an onResult
callback in this object,
contains the return result from that method flattened into a string. See
“
Passing values between applications” on page 176.
X If this message contains an error notification for the onError callback, contains
the error message.
headers
Object A JavaScript object containing script-defined headers. Read/write.
Use this property to define custom header data to send supplementary
information between applications. You can add any number of new headers. The
headers are name/value pairs, and can be accessed with the JavaScript dot
notation (
msgObj.headers.propName), or bracket notation
(
msgObj.headers[propName]). If the header name conforms to JavaScript symbol
syntax, use the dot notation. If not, use the bracket notation.
The predefined header
["Error-Code"] is used to return error messages to a
sender; see “
Messaging error codes” on page 190.
Examples of setting headers:
bt.headers.info = "Additional Information";
bt.headers ["Error-Code"] = 8;
Examples of getting header values:
var info = bt.headers.info;
var error = bt.headers ["Error-Code"];
sender
String The application specifier for the sending application (see “Application specifiers”
on page 191). Read/write.
target
String The application specifier for the target, or receiving, application (see “Application
specifiers” on page 191). Read/write.
timeout
Number The number of seconds before the message times out. Read/write.
If a message has not been removed from the input queue for processing before
this time elapses, the message is discarded. If the sender has defined an
onTimeout
callback for the message, the target application sends a time-out
message back to the sender.
Comentários a estes Manuais