Table of Contents & Menu
On this page

No subsections

Navigation

window.dispatchMessages()

Use the global window.dispatchMessages() function to display messages.

The function accepts one or two arguments:

  1. An array of message objects. Each object must contain:

    • type: The message category (e.g., "success", "notice", "warning", "error").
    • text: The message content. HTML and <br/> line breaks are supported.
  2. An optional duration (in milliseconds) for how long the message should be displayed. If omitted, the message remains until manually dismissed by the user.

dispatchMessages([
    {
        type: "success",
        text: "Well done! Make haste, my friend, because this message as ephemeral all good things are!"
    }
], 2000);