Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How set ajax data to Bootbox dialog?

Tags:

ajax

bootbox

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",
            },
        }
    });
like image 652
Newbie Avatar asked Jan 22 '14 12:01

Newbie


1 Answers

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",
                },
            }
        });
    }
});
like image 81
user3246025 Avatar answered Nov 20 '22 19:11

user3246025