[英]JQuery Alertify confirm dialog box not working properly
I am using Alertify JQuery Plugin, to display alert,confirm, dialog
box. 我正在使用Alertify JQuery插件来显示
alert,confirm, dialog
。
Problem am facing for confirmation, it not work correctly on ok or cancel click 问题正待确认,无法正常运行或取消点击
JS Code: JS代码:
function myconfrm() {
var falgset = true;
alertify.confirm("Are you sure to delete this record.", function (e) {
if (e) {
// user clicked "ok"
falgset = false;
}
});
alert(falgset);
return falgset;
}
$("#btn").live('click', function (event) {
if (myconfrm()) {
// my ajax call
}
});
This is how i solved 这就是我解决的方法
JS Fiddle DEMO JS Fiddle演示
$("#btn").live("click", function () {
alertify.confirm("Are you sure you want to delete?", function (asc) {
if (asc) {
//ajax call for delete
alertify.success("Record is deleted.");
} else {
alertify.error("You've clicked cancel");
}
}, "Default Value");
});
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.