-
Notifications
You must be signed in to change notification settings - Fork 724
How to Use
fabien-d edited this page Dec 1, 2012
·
5 revisions
<!-- ideally at the bottom of the page -->
<!-- also works in the <head> -->
<script src="PATH_TO_FILE/alertify.min.js"></script>
define(["PATH_TO_FILE/alertify.min"], function (alertify) {
// alertify is now available
});
alertify.log( message, type );
shorthand available to "success" and "error"
alertify.success( message ); // same as alertify.log( message, "success" );
alertify.error( message ); // same as alertify.log( message, "error" );
extend method allows for custom methods
alertify.custom = alertify.extend( "custom" );
alertify.custom( message ); // same as alertify.log( message, "custom" );
alertify.alert( message, function () {
//after clicking OK
});
alertify.confirm( message, function (e) {
if (e) {
//after clicking OK
} else {
//after clicking Cancel
}
});
alertify.prompt( message, function (e, str) {
if (e) {
// after clicking OK
// str is the value from the textbox
} else {
// after clicking Cancel
}
});
alertify.alert(...).confirm(...)...