I want to run ajax in every loop of the selected checkbox. However 'jquery each' ignores the ajax process. Completed or not completed the loop will continue. Sorry for my language, hope it's understandable.
Here is an example of the code I made.
$('input[name="options[]"]:checked').each(function() {
jQuery.ajax({
url: "www.example.com",
type: "POST",
data: {
name:name
},
success: function(data) {
// do something
}
});
});
I have tried using async:false in the ajax option, but the page freezes, and will return to normal after the process is complete.