1
I have the following button:
<button type="button" class="btn btn-default" data-toggle="modal" data-target="#abrir-imagem" data-pasta="interno_fotos" data-imagem="139379939.jpg">Abrir Imagem</button>
I need to retrieve it through Ajax. And I did it this way:
$('#abrir-imagem').on('show.bs.modal', function(e) {
var pasta = $(this).data("pasta")
var imagem = $(this).data('imagem');
$("#imagem").html("<img src='"+BASE_URL+"assets/uploads/"+pasta+"/"+imagem+"'>");
});
It opens the modal correctly, however, the image does not appear. It says that the two variables are undefined. What is the right way to seek them?