I have an admittedly large amount of ajax requests being sent out with an onclick trigger.
(Probably close to 30 requests).
It looks something like this:
if($(this).attr('id') == 'checkbox'){
var type = 'checkbox';
// loop over checkbox inputs and store in array 'checkboxarray'
var checkboxarray = [];
$(this).find('input').each(function(){
checkboxarray.push($(this).next('span').text());
});
}
else if($(this).attr('id') == 'dates'){
var type = 'dates';
var default_value = $(this).find('input').val();
}
else{
alert('Error: There has been an unknown extra iteration');
}
// Send as ajax call to be processed
$.ajax({
type: "POST",
url: "process.php",
data: "type="+type+"&default_value="+default_value+"&checkboxarray="+checkboxarray+,
success: function(html){
}
});
$("#processessing").show();
$('#outer_container').html('<br /><br />Processing…<br /><br />');
// once all of the requests stop, fire it off.
$("#processessing").ajaxStop(function(){
$(this).hide();
$('#outer_container').html('Saved');
function redirect(){
window.location = "page.php";
}
setInterval(redirect,500);
});
On small amounts of data this works, but on large sets of data, a lot gets lost... any suggestions?