An alert dialog is often used if you want to make sure information comes through to the user.
When an alert dialog pops up, the user will have to click "OK" to proceed.
You create an alert dialog by invoking alertify.alert(...)
Calling alertify.alert() the dialog parameter-less constructor will return the alert dialog instance. You can use this syntax to modify dialog settings before showing it.
Also you can get the dialog instance (singletons only) by invoking alertify.dialog('alert');
/*
* @title {String or DOMElement} The dialog title.
* @message {String or DOMElement} The dialog contents.
* @onok {Function} Invoked when the user clicks OK button or closes the dialog.
*
* alertify.alert(title, message, onok);
*
*/
alertify.alert('Alert Title', 'Alert Message!', function(){ alertify.success('Ok'); });
For convenience, the following overloads are also available:
/*
* @message {String or DOMElement} The dialog contents.
*
* alertify.alert(message);
*
*/
alertify.alert('Alert Message!');
/*
* @title {String or DOMElement} The dialog title.
* @message {String or DOMElement} The dialog contents.
*
* alertify.alert(title, message);
*
*/
alertify.alert('Alert Title', 'Alert Message!');
/*
* @message {String or DOMElement} The dialog contents.
* @onok {Function} Invoked when the user clicks OK button or closes the dialog.
*
* alertify.alert(message, onok);
*
*/
alertify.alert('Alert Message!', function(){ alertify.success('Ok'); });