Skip to content

Commit 6c3c924

Browse files
committed
return form element with deferred
1 parent b591d71 commit 6c3c924

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/jquery.ajaxchimp.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Author: Siddharth Doshi
55
66
Use:
77
===
8-
$('#form_id').ajaxchimp(options);
8+
$('#form_id').ajaxChimp(options);
99
1010
- Form should have one <input> element with attribute 'type=email'
1111
- Form should have one label element with attribute 'for=email_input_id' (used to display error/success message)
@@ -167,10 +167,10 @@ For e.g. 'http://blahblah.us1.list-manage.com/subscribe/post-json?u=5afsdhfuhdsi
167167
success_div.text('').hide();
168168
error_div.text(msg).show(500);
169169
}
170-
deferred.resolve(data, textStatus, jqXHR);
170+
deferred.resolve(data, textStatus, jqXHR, form);
171171
}).fail(function (jqXHR, textStatus, errorThrown) {
172172
console.log('mailchimp ajax submit error: ' + errorThrown);
173-
deferred.reject(jqXHR, textStatus, errorThrown);
173+
deferred.reject(jqXHR, textStatus, errorThrown, form);
174174
});
175175

176176
// Translate and display submit message

test/test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
$(document).ready( function () {
22
$('.subscribe').attr('action', submit_url);
33
var a = $('.subscribe').ajaxChimp();
4-
a.done(function (data, textStatus, jqXhr) {
4+
a.done(function (data, textStatus, jqXhr, form) {
55
console.log(data);
66
});
77

0 commit comments

Comments
 (0)