I've got this code: It comes after some if querys and this works perfectly. The first ajax request works also fine but after the each loop the second request wont be executed. Idk why, hopefully someone have a solution.
alert("success"); // Everything is OK
$( ".nrlist-create_item-select" ).each(function() {
var item_id = $( this ).attr('id');
var item_name = $( this ).attr('title');
$.ajax({
type: "POST",
url: "games/create-nr_vs_nr-update.php",
datatype: "text",
data: {item_id: item_id, item_name: item_name, nrlistcreatenumber: nrlistcreatenumber, nrlistcreatetime: nrlistcreatetime},
success: function(data) {
alert(data);
requestCallback.requestComplete(true);
}
});
return true;
});
$.ajax({
type: "POST",
url: "games/create-nr_vs_nr-insert.php",
datatype: "text",
data: {item_id: item_id, item_name: item_name, nrlistcreatenumber: nrlistcreatenumber, nrlistcreatetime: nrlistcreatetime},
success: function(data) {
alert(data);
requestCallback.requestComplete(true);
}
});