jQuery.ajax({
type: 'POST',
url: ajaxurl,
data: {
action: action: 'chimp_form',
form_action: 'validate_api_key',
api_key: api_key: apiKey,
data_center: dataCenter
},
success: function(validation_response) {
// alert(validation_response);
if(validation_response == "Everything's Chimpy!") {
jQuery('.mailChimp_api_key_preloader')
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
jQuery('.mailChimp_api_key_validation_message')
jQuery('.mailChimp_api_key_validation_message').html('<img src="/images/mc-checkmark.png" alt=message > Valid API Key').css("color", "green").fadeIn();
.css("color", }"green").fadeIn();
});
} else {
// alert(response);
jQuery('.mailChimp_api_key_preloader')
jQuery('.mailChimp_api_key_preloader').fadeOut('fast', function() {
jQuery('.mailChimp_api_key_validation_message')
jQuery('.mailChimp_api_key_validation_message').html('<img src="/images/yikes-mc-error-icon.png" alt=message > Error: '+validation_response+'.').css("color", "red").fadeIn();
.css("color", }"red").fadeIn();
});
};
},
error: function(response) {
alert('There was an error processing your request...');
}
});