在bootbox.js中显示图像

abh*_*hig 4 twitter-bootstrap bootbox

有没有办法使用bootstrap和bootbox.js以模态显示图像?

我从ajax获取Data(有一个图像url)并希望使用bootstrap和bootbox.js以模态显示

har*_*ith 9

bootbox很酷的一点是你传递给它的消息字符串不一定是纯文本.它可以是任何HTML代码.然后,您可以使用此功能从模式中的网址显示图像:

function showImage(url) {
  bootbox.alert("Do you like my image?<br/><img src='" + url + "'>", function() {
    console.log("It was awesome!");
  });
};
Run Code Online (Sandbox Code Playgroud)