我正在使用 Bootstrap 2.3.1 和 Bootbox 3.3.0 版。当我编写以下代码时:
bootbox.dialog({message:"test"});
出现空的模态窗口。如果我使用引导箱的“警报”方法,一切正常。我在 Safari(6.0.3) 和 Firefox (24.0) 中对其进行了测试。
有人遇到过这个问题吗?
塔玛拉。
我正在使用 Bootstrap 2.3.1 和 Bootbox 3.3.0 版。当我编写以下代码时:
bootbox.dialog({message:"test"});
出现空的模态窗口。如果我使用引导箱的“警报”方法,一切正常。我在 Safari(6.0.3) 和 Firefox (24.0) 中对其进行了测试。
有人遇到过这个问题吗?
塔玛拉。
Bootbox 3.x 不接受对象参数。为此,您必须升级到 Bootstrap 3 和 Bootbox 4.x。
下面是 Bootbox 3.x 对话框的示例:
var boxContentString = "html formatted text goes here";
bootbox.dialog(boxContentString,[
//buttons
{
"label" : "Button 1",
"class" : "btn-success",
"callback": function(e){
//do stuff
}
},
{
"label" : "Button 2",
"callback": function(e){
//do stuff
}
}
]);