0
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>");
}
});
}
});
}
});
}
Are 2 ajax one inside the other that need to compare 2 different tables and generate the list of selects and the options of the selects, the if separates the options that are not of such select.
Your problem is just comparing if the two arrays are equal?
– Samir Braga
no, I need to compare and when I have equal item in arrays it lists, and are several equal items with the same id for example, type 3 items in "data1" equal in "data2"
– Alan PS