ebs.alert
(FintechOS Studio 20.2.1 and later)
Displays a modal window with one button (an alert window).
Syntax
Copy
function ebs.alert(options: IEbsAlertOptions, yesFunction: Function): void;
Parameter | Type | Description |
---|---|---|
options
|
IEbsAlertOptions | Settings for the title, message, and button label. |
yesFunction (optional) |
function | Callback function to run when pressing the alert window button. |
Type Aliases
IEbsAlertOptions
JSON object containing details about the title, message, and label for the button used to close the alert window and proceed.
Copy
{
title: string;
message: string;
yesButtonLabel?: string;
}
Property | Type | Description |
---|---|---|
title
|
string | Tile of the alert window. |
messag
|
string | Content of the alert window. You can use HTML to format your output. |
yesButtonLabel (optional) |
string | Label on the alert window button. |
Examples
Generate a cookie consent alert message
In this example, we create a cookie consent alert message with the following features:
- The alert title is Cookie Consent.
- The alert message is We use cookies. This site uses cookies to offer you a better browsing experience. By continuing to use our site, you consent to the use of cookies.
- The label used to close the alert window and proceed is I agree.
Copy
ebs.alert({
title: 'Cookie Consent',
message: '<h1>We use cookies</h1><p>This site uses cookies to offer you a better browsing experience.<p><p>By continuing to use our site, you consent to the use of cookies.</p>',
yesButtonLabel: 'I agree'
})
This will display the following alert window in the user interface: