Modal with json object

0

I need to get an image by json to appear in my modal but the modal appears but the image does not

Here is my code

$("#estoque1").click(function(){
    $('#estoqueModal').modal('show');
    $(".modal-body").innerHTML += '<img src="' + dadosJSON.estoque.imgModal + '">';
});
    
asked by anonymous 16.04.2017 / 03:32

1 answer

1

You must have already switched lines, right? If not, do and test.

Some points to check ... Can you print the image without being modal? If so, try loading it asynchronously, setTimeout(function(){ $(".modal-body").innerHTML += '<img src="' + dadosJSON.estoque.imgModal + '">'; } Or put in the "onShow" event of the modal, see the modal documentation that you are using.

    
17.04.2017 / 15:46