Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing image in bootbox.js

Is there any way to show images in modal using bootstrap and bootbox.js?

I am getting Data (which has an image url) from ajax and want to show in a modal using bootstrap and bootbox.js

like image 620
abhig Avatar asked Nov 13 '13 17:11

abhig


1 Answers

The cool thing with bootbox is that the message string you pass to it doesn't have to be plain text. It can be any html code. You can then have this function to show an image from an url in a modal:

function showImage(url) {
  bootbox.alert("Do you like my image?<br/><img src='" + url + "'>", function() {
    console.log("It was awesome!");
  });
};
like image 181
haradwaith Avatar answered Nov 09 '22 17:11

haradwaith