Uncaught (in promise) SweetAlert: You can only use SweetAlert AFTER the DOM has loaded! code example
Example: Uncaught (in promise) cancel
swal({
…
}).then(function(json_data) {
…
}, function(dismiss) {
if (dismiss === 'cancel') { // you might also handle 'close' or 'timer' if you used those
// ignore
} else {
throw dismiss;
}
})