8

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",
            },
        }
    });
Newbie
  • 81
  • 1
  • 1
  • 2

1 Answers1

36
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",
                },
            }
        });
    }
});
vsj
  • 34
  • 4
user3246025
  • 361
  • 2
  • 2