如何使用swal jquery插件从数据库中删除行?

时间:2015-03-11 23:16:41

标签: java jquery

我正在尝试使用上面的代码从数据库中删除用户。但它没有执行。怎么办?

function confirmDelete(id) {
var x = swal({
    title: "Sure?",
    text: "Are you sure you want to delete this user?!",
    type: "warning",
    showCancelButton: true,
    confirmButtonColor: '#DD6B55',
    confirmButtonText: 'Delete!',
    cancelButtonText: "Cancel!",
    closeOnConfirm: false,
    closeOnCancel: false
});
if (x == closeOnConfirm) {
    window.location.href = "/user/delete/" + id;
    swal('Deleted!', 'It was deleted.', 'success');
}
}

0 个答案:

没有答案