I have the following function:
function pre() {
$.ajax({
url: "arquivo1.php",
method: 'POST',
dataType: 'json',
success: function (data) {
$.ajax({
url: "arquivo2.php",
method: 'POST',
dataType: 'json',
success: function (data2) {
$.each(data.id, function(i, item) {
$( ".lado" ).prepend("<div id='" + data.id + "'><select class='select'></select></div>");
if (data.id == data2.id) {
$( ".select" ).append("<option'>" + data2.id + "</option>");
}
});
}
});
}
});
}
There are 2 ajax within each other that need to compare 2 different tables and generate selects list and selects options, if separates options that are not from such select.