Skip to content

Commit 3f8a7f8

Browse files
committed
support requirejs/commonjs based on #56 by @kitx
1 parent 8a476df commit 3f8a7f8

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/jquery.ajaxchimp.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,15 @@ To get the mailchimp JSONP url (undocumented), change 'post?' to 'post-json?' an
3030
For e.g. 'http://blahblah.us1.list-manage.com/subscribe/post-json?u=5afsdhfuhdsiufdba6f8802&id=4djhfdsh99f&c=?',
3131
*/
3232

33-
(function ($) {
33+
;(function (factory) {
34+
if (typeof define === 'function' && define.amd) {
35+
define(['jquery'], factory);
36+
} else if (typeof exports === 'object') {
37+
module.exports = factory(require('jquery'));
38+
} else {
39+
factory(jQuery);
40+
}
41+
}(function ($) {
3442
'use strict';
3543

3644
$.ajaxChimp = {
@@ -233,4 +241,4 @@ For e.g. 'http://blahblah.us1.list-manage.com/subscribe/post-json?u=5afsdhfuhdsi
233241
}
234242
return deferreds;
235243
};
236-
})(jQuery);
244+
}));

0 commit comments

Comments
 (0)