如何将ajax数据设置为Bootbox对话框?

时间:2014-01-22 12:01:41

标签: ajax bootbox

如何将数据从ajax设置为bootbox对话框?或者我需要使用jquery ui对话框,何时需要设置一些数据?

此代码无效

bootbox.dialog({
        message: data,
        title: "Custom title",
        buttons: {
        success: {
                label: "Success!",
                className: "btn-success",
            },
        }
    });

1 个答案:

答案 0 :(得分:34)

jQuery.ajax({
    type: 'POST',
    url: $(this).attr('href'),
    success: function(data) {
        bootbox.dialog({
            message: data,
            title: "Custom title",
            buttons: {
                success: {
                    label: "Success!",
                    className: "btn-success",
                },
            }
        });
    }
});