## Game > Gamebase > JavaScript SDK User Guide > UI
Displays a system alert.
Displays an alert dialog simply by entering a message.
toast.Gamebase.Util.showAlert(message, () => { ... }));
Example
function showAlert() {
toast.Gamebase.Util.showAlert('message', function() {
console.log('Alert Closed');
});
}
Use the following API to call back the processed result after the alert dialog has been displayed.
toast.Gamebase.Util.showConfirm(message, (isConfirmed) => { ... });
Example
function showConfirm() {
toast.Gamebase.Util.showConfirm('message', function (isConfirmed) {
if (isConfirmed) {
console.log('OK Button Clicked');
} else {
console.log('Cancel Button Clicked');
}
});
}
Error | Error Code | Description |
---|---|---|
UI_UNKNOWN_ERROR | 6999 | Unknown error.(Undefined error). |