I have a code made to fetch images but it's a bit more complicated than that.
$("#publi_not").change(function(){
var p = 0;
var r = 1;
var val = $(this).val();
var valor = $('#publi_not option[value="'+val+'"]').html();
var n_pub = $('#publi_not option[value="'+val+'"]').data("numero")+1;
var balance = $("#imagens_not").get(0).files.length;
var pub_txt = $("#text_img").val();
var pub = pub_txt;
for(t=1;t<=balance;t++){
if(n_pub<=t){
r=1;
}
$(".images"+p+" .images_pub").html("<img src='pubs/"+valor+"/"+valor+r+".png' style='width:100%' /><div class='altera' style='margin-top:-20px;top:0;left:2px;position:absolute;color:white;'><small><small><small><b>"+pub+"</b></small></small></small></div>");
p++;
r++;
}
});
The code is executed when I change the value in select
which will then add a div below depending on what is selected.
The problem is as follows. I recently created a table (because the former was based on tests) which has the names of the images but how do I display the files?
I thought of just reading the files from a folder with the name of the advertisement but even that I did not get it.