IFrame Message

Block Group: Browser API
Icon:IFrame Message block icon

Allows messages to be passed from an IFrame to its parent. This block can be used to get information from another domain or another instance of this .dg5 file.

For information on using dataflow blocks, see Dataflow.


Input/Output Properties

These properties can take input and give output.

  • invoke (trigger)
  • enabled (boolean)
  • interval (number)
  • autoRun (boolean)
  • timeout (number)
  • message (string)
  • key (string)
  • match (string)
  • origin (string)
  • matchRegExp (string)

invoke causes the message to be sent. Only works if enabled is set to TRUE.

enabled specifies whether message sending is enabled.

  • TRUE: Messages are sent as specified by invoke, autoRun, and interval.
  • FALSE: No messages are sent.

interval specifies how often the message is sent automatically, in seconds. A value of 0 means that it is sent on autoRun or invoke only.

autoRun specifies whether the message is sent automatically when the page loads.

timeout specifies how long the sending attempt will continue before it is canceled, in seconds.

message holds the message to send, if it is a JSON string. Use this property when sending a message from DGLux5.

key and match specify a key-value pair that must be matched somewhere in the JSON message, in order for the message to be sent. Use a value of * for match to accept any value for the specified key. Use these properties when sending a message from DGLux5.

matchRegExp specifies a regular expression that the message must match.


Output Properties

These properties can give output. They cannot take input.

  • loading (boolean)
  • output (string)
  • error (string)

loading returns TRUE if the message is currently being sent, FALSE otherwise.

output returns the message.

error returns the error message, if any.


Model

This is a basic use of the block.

Dataflow Model
IFrame Message dataflow modelA key called "status" is required. Because "status" is one of the keys in the message, the message is sent.