如何在 'sweetAlert' 警报 'ok' 单击后调用 bootstrap 模式?

How to call a bootstrap modal after 'sweetAlert' alert 'ok' clicked?

我想在单击 sweetAlert 警报上的 "OK" 按钮后调用 bootstrap 模式。

因此,在用户单击 sweetAlert 警报上的 OK 按钮后。它会自动调用 bootstrap 模式。我在 javascript 中尝试了下面的代码,但没有成功。

BOOTSTRAP 模态

<div class="modal fade" id="change_password" role="dialog">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body change_password">
            </div>
        </div>
    </div>
</div>

JS代码

<script language='javascript'>
    swal({
        title: 'Sample Title',
        text: 'Hi',
        type: 'success',
        allowOutsideClick: true,
        html: true
    },
    function () {
        $('#change_password').modal('show');
    });
</script>

您的代码运行良好

swal({
    title: 'Sample Title',
    text: 'Hi',
    type: 'success',
    allowOutsideClick: true,
    html: true
},
function () {
    $('#change_password').modal('show');
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
<link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet"/>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="modal fade" id="change_password" role="dialog">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
            <div class="modal-body change_password">
                Modal body
            </div>
        </div>
    </div>
</div>