It is redirecting to profile page when I click the close button. But it goes onclose event section and it should not refresh the page as It returns false but redirecting to profile page.
alertify.alert().setting({
'title': 'Message',
'label': 'Ok',
'message': 'You have not yet enabled Appointment on your profile?',
'onok': function () {
document.location.href = "/profile";
},
'onclose':function(e){
return false;//It should stop redirecting on profile page
}
}).show();
Error: When I click on Ok or Close(X) both events are firing.
Thanks.
As per the documentation of
alertifythis is the default functionality ofalert onokevent.So when
onokevent is being called in alert It automatically callsoncloseevent to close the dialog.