window.dispatchMessages()
Hyvä provides a global function window.dispatchMessages() to show messages.
The function takes one or two arguments:
-
An array of message objects.
Each message object has atypeand atext.
The type is usually one of"success","notice","warning"or"error".
The text is the message to display. HTML and<br/>linebreaks in message are possible. -
The optional second parameter is the duration in ms after which the message disappears. If no duration is supplied, the message will remain until the user dismisses it with a click on the X icon.