Newbie
Newbie

Reputation: 81

How set ajax data to Bootbox dialog?

How can i set data from ajax to bootbox dialog? Or I need use jquery ui dialog, when need to set some data?

this code not working

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

Upvotes: 8

Views: 13869

Answers (1)

user3246025
user3246025

Reputation: 361

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",
                },
            }
        });
    }
});

Upvotes: 36

Related Questions