SweetAlert jQuery 在成功回调中不工作

SweetAlert jQuery not working in success callback

我在使用 SweetAlert 时无法让任何 jQuery 工作。

在下面的 fiddle 中,我想在成功时隐藏框 div。

我是不是漏掉了什么明显的东西?

function confirmDelete() {
swal({
    title: "Are you sure?",
    text: "You will not be able to recover this imaginary file!",
    type: "warning",
    showCancelButton: true,
    confirmButtonColor: "#DD6B55",
    confirmButtonText: "Yes, delete it!",
    closeOnConfirm: false
}, function (isConfirm) {
    if (!isConfirm) return;
    $.ajax({
        url: "scriptDelete.php",
        type: "POST",
        data: {
            id: 5
        },
        dataType: "html",
        success: function () {
            swal("Done!", "It was succesfully deleted!", "success");
            $('#box').hide();
        },
        error: function (xhr, ajaxOptions, thrownError) {
            swal("Error deleting!", "Please try again", "error");
        }
    });
});
}

Fiddle

这不起作用的原因是第一个 JS 函数的 URL 无效,它进入了错误块,实际上并没有在成功块中调用 hide 函数。