window.dispatchMessages()
Use the global window.dispatchMessages() function to display messages.
The function accepts one or two arguments:
-
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.
-
An optional
duration(in milliseconds) for how long the message should be displayed. If omitted, the message remains until manually dismissed by the user.