The flashMsg widget can be used to display a 'flash message' to the user - a short notification that appears on the screen for a few seconds, before disappearing. It is commonly used for 'success' messages when an action occurs.
A flash message can be created with the data API, as follows:
<span data-ipsFlashMsg data-ipsFlashMsg-text='My message'>
The element used with this method is not important; the widget will not interact with the element in any way.
Flash messages can be automatically created in two additional ways:
- Cookies - set a cookie with the key flmsg. The cookie will be deleted after the message displays.
- URL - pass the parameter flmsg in the page URL, with the value being the message to show. The value should be URL encoded.
The text to display in the flash message. A sentence or two maximum is recommended.
(String; optional; default 'ipsPad')
A space-separated string of extra CSS classnames that will be applied to the flash message box.
(Number; optional; default 2)
The number of seconds for which this flash will be shown before hiding itself.
Hides the currently-shown flash message. If any messages are queued, the next will be shown automatically.