aelvan/mailchimp-subscribe-craft — pull request #2 by imjakechapman (2014-04-22 23:15:25+00:00)
Title: Pull Request: Added appropriate Ajax responses.

I added appropriate Ajax responses for all responses so you can now do this in JS.

// Stop form from submitting

$('input[type="submit"]').on("click", function(event) {
event.preventDefault();

$.post('/', $(this).parent().serialize())
.done( function(data) {

if (!data.success)
{
// there was an error, do something with data
alert(data.message);
}
else
{
// Success
alert("WEEEEEEEEEE");
}

});
});