window.dispatchMessages()
YSCP 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 a type and a text.
- 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
Xicon.
ispatchMessages([
{
type: "success",
text: "Well done! Make haste, my friend, because this message as ephemeral all good things are!"
}
], 2000);