I want to return the result in place of false.Please help me out, already tried using window object and putting it in a variable then accessing.
$(document).ready(function() {
$('#confirm').on('click', function() {
bootbox.confirm("Are You Sure ?", function(result) {
bootbox.alert("Confirm result: " + result)
});
return false;
});
});
bootbox.confirm
is an async operation, unlikewindow.confirm
which stops Javascript execution until the user makes a choice. So if you intend to do some operation once user confirms or cancels, you can do it in the callback function. But you can't return it as a value. You could do something like this: