I have a number of checkboxes and if a checkbox is checked I am sending its value with .ajax.
At the moment I am using async : false to make sure it loops from the next after the ajax success.
However, it kind of freezes the browser until it completes .each loop.
I saw something similar done here: jQuery continue loop execution after ajax success but can't figure out how to adapt it to my case where I am using .each instead of for
$("input:checkbox:checked").each(function () {
$.ajax({
async : false,
url:"import.php",
method:"POST",
data:{id:id, val:val},
success:function(data) {
//do some action
}
});
});