<script>
$(".loads").on("click", function(){
$.ajax({
type: "POST",
url: "js/addImgbig.php",
success: function(newImg){
arrayId = newImg.id.split(",");
for (var i = 0; i < arrayId.length; i++) {
$.ajax({
type: "POST",
data: "oneId="+arrayId[i],
url: "js/comentshow.php",
success: function(comments){
console.log("test1", test);
var test = comments.id;
console.log("test2", test);
}
});
}
}
});
});
</script>