$.each(emails, function(index, value)
{
$.post('ajax/send_email.php', { email: value, ... }, function(data)
{
$('#emails_sent').text('Sent ' + (index + 1) + '/' + num_emails);
});
});
In
$(function()
{
$('#cancel').on('click', function(e)
{
hidePopupWindow();
});
});
While $.each
is running none of the buttons such as cancel work — they can't be selected or pressed.