✨ A beautiful, responsive, highly customizable and accessible (WAI-ARIA) replacement for JavaScript's popup boxes. Zero dependencies. 🇺🇦
MIT License
Published by limonte over 8 years ago
Before 1.0.0 callback function was used to handle the result of modal dialog:
swal(
{title: 'Are you sure?', showCancelButton: true},
function(isConfirm) {
...
}
);
Starting with v1.0.0 promise should be used instead of the callback:
swal({title: 'Are you sure?', showCancelButton: true}).then(
function(isConfirm) {
...
}
);
isConfirm
is:
true
for confirm buttonfalse
for calcel buttonundefined
for outside click or if modal was closed by timerTo enable IE10+ support, include es6-promise
:
<script src="bower_components/es6-promise/promise.min.js"></script>