Here is what I have. enter image description here #Image is working ok, but #act not. #act should write ACTION on bottom of every article(image) that meets requirment of Servlet (if data!=null). Unfortunately, I have ActionAction on bottom of first image. What should I correct? And sorry for my bad English.
for(var i = 0; i<data.length; i++){
$("#image").append(
"<div class=divovi id="+data[i].sifra+">" +
"<div><img width=150 height=150 border=2 align=middle id=\"slikaID\" src="+data[i].slika+" /></div>" +
"<div>"+data[i].naziv+"</div><div id=act></div></div>"
);
$.post("http://localhost:8080/Projekat/DaLiJeNaAkcijiServlet",
{
data:JSON.stringify({ naslov:data[i].sifra})
},
function(data,status){
if(data!=null) {
$("#act").append('ACTION');
}
}
);
}