Alertify
Alertify
If a user needs to confirm an action before it is executed, you should use a confirm prompt. For more information about usage and available options, please refer to the plugin documentation and to the code example below.
//Markup
<button id="alertify-demo-1" class="button h-button">Launch Alert</button>
//Javascript
$('#alertify-demo-1').on('click', function () {
initConfirm('Standard Alert', 'Are you sure you want to perfom this action? You won\'t be able to recover or to revert it.', false, false, 'Delete', 'Cancel');
})
With Callback
A callback function can be executed when the OK or CANCEL buttons are pressed. For more information about usage and available options, please check the provided code example.
//Markup
<button id="alertify-demo-2" class="button h-button">Launch Alert</button>
//Javascript
$('#alertify-demo-2').on('click', function () {
initConfirm('Custom Alert', 'You can pass a callback function as a callback parameter to define what happens after the confirm button is clicked.', false, false, 'Callback', 'Cancel', function (closeEvent) {
alert('The callback was executed!')
})
})